Skip to content

[UI] Add options to sort games by title and status #1249

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
May 1, 2022
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"plugins": ["react", "@typescript-eslint"],
"settings": {
"react": {
"version": "17.0"
"version": "detect"
}
},
"rules": {
Expand Down
9 changes: 2 additions & 7 deletions electron/legendary/library.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,13 +156,8 @@ export class LegendaryLibrary {
} catch (error) {
logError(`${error}`, LogPrefix.Legendary)
}
const arr = Array.from(this.library.values()).sort(
(a: { title: string }, b: { title: string }) => {
const gameA = a.title.toUpperCase().replace('THE ', '')
const gameB = b.title.toUpperCase().replace('THE ', '')
return gameA < gameB ? -1 : 1
}
)
const arr = Array.from(this.library.values())

if (format === 'info') {
if (libraryStore.has('library')) {
libraryStore.delete('library')
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@
"@fontsource/rubik": "^4.5.6",
"@fortawesome/fontawesome-svg-core": "^6.1.1",
"@fortawesome/free-brands-svg-icons": "^6.1.1",
"@fortawesome/free-regular-svg-icons": "^6.1.1",
"@fortawesome/free-solid-svg-icons": "^6.1.1",
"@fortawesome/react-fontawesome": "^0.1.18",
"@mui/icons-material": "^5.6.2",
Expand Down
4 changes: 3 additions & 1 deletion public/locales/bg/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,9 @@
"library": {
"gridView": "Изглед във вид на решетка",
"listView": "Изглед във вид на списък",
"refresh": "Опресняване"
"refresh": "Опресняване",
"sortByStatus": "Sort by Status",
"sortByTitle": "Sort by Title"
},
"Library": "Библиотека",
"loading": {
Expand Down
4 changes: 3 additions & 1 deletion public/locales/ca/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,9 @@
"library": {
"gridView": "",
"listView": "",
"refresh": ""
"refresh": "",
"sortByStatus": "Sort by Status",
"sortByTitle": "Sort by Title"
},
"Library": "Biblioteca",
"loading": {
Expand Down
4 changes: 3 additions & 1 deletion public/locales/cs/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,9 @@
"library": {
"gridView": "",
"listView": "",
"refresh": ""
"refresh": "",
"sortByStatus": "Sort by Status",
"sortByTitle": "Sort by Title"
},
"Library": "Knihovna",
"loading": {
Expand Down
4 changes: 3 additions & 1 deletion public/locales/de/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,9 @@
"library": {
"gridView": "Rasteransicht",
"listView": "Listenansicht",
"refresh": "Aktualisieren"
"refresh": "Aktualisieren",
"sortByStatus": "Sort by Status",
"sortByTitle": "Sort by Title"
},
"Library": "Bibliothek",
"loading": {
Expand Down
4 changes: 3 additions & 1 deletion public/locales/el/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,9 @@
"library": {
"gridView": "Προβολή Πλέγματος",
"listView": "Προβολή Λίστας",
"refresh": "Ανανέωση"
"refresh": "Ανανέωση",
"sortByStatus": "Sort by Status",
"sortByTitle": "Sort by Title"
},
"Library": "Βιβλιοθήκη",
"loading": {
Expand Down
4 changes: 3 additions & 1 deletion public/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,9 @@
"library": {
"gridView": "Grid view",
"listView": "List view",
"refresh": "Refresh"
"refresh": "Refresh",
"sortByStatus": "Sort by Status",
"sortByTitle": "Sort by Title"
},
"Library": "Library",
"loading": {
Expand Down
4 changes: 3 additions & 1 deletion public/locales/es/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,9 @@
"library": {
"gridView": "Vista de cuadrícula",
"listView": "Vista de lista",
"refresh": "Actualizar"
"refresh": "Actualizar",
"sortByStatus": "Sort by Status",
"sortByTitle": "Sort by Title"
},
"Library": "Biblioteca",
"loading": {
Expand Down
4 changes: 3 additions & 1 deletion public/locales/et/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,9 @@
"library": {
"gridView": "Ruudustikvaade",
"listView": "Loendivaade",
"refresh": "Värskenda"
"refresh": "Värskenda",
"sortByStatus": "Sort by Status",
"sortByTitle": "Sort by Title"
},
"Library": "Varamu",
"loading": {
Expand Down
4 changes: 3 additions & 1 deletion public/locales/fa/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,9 @@
"library": {
"gridView": "",
"listView": "",
"refresh": ""
"refresh": "",
"sortByStatus": "Sort by Status",
"sortByTitle": "Sort by Title"
},
"Library": "کتابخانه",
"loading": {
Expand Down
4 changes: 3 additions & 1 deletion public/locales/fi/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,9 @@
"library": {
"gridView": "",
"listView": "",
"refresh": ""
"refresh": "",
"sortByStatus": "Sort by Status",
"sortByTitle": "Sort by Title"
},
"Library": "Kirjasto",
"loading": {
Expand Down
4 changes: 3 additions & 1 deletion public/locales/fr/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,9 @@
"library": {
"gridView": "",
"listView": "",
"refresh": ""
"refresh": "",
"sortByStatus": "Sort by Status",
"sortByTitle": "Sort by Title"
},
"Library": "Bibliothèque",
"loading": {
Expand Down
4 changes: 3 additions & 1 deletion public/locales/gl/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,9 @@
"library": {
"gridView": "Vista de cadrícula",
"listView": "Vista de lista",
"refresh": "Actualizar"
"refresh": "Actualizar",
"sortByStatus": "Sort by Status",
"sortByTitle": "Sort by Title"
},
"Library": "Biblioteca",
"loading": {
Expand Down
4 changes: 3 additions & 1 deletion public/locales/hr/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,9 @@
"library": {
"gridView": "",
"listView": "",
"refresh": ""
"refresh": "",
"sortByStatus": "Sort by Status",
"sortByTitle": "Sort by Title"
},
"Library": "",
"loading": {
Expand Down
4 changes: 3 additions & 1 deletion public/locales/hu/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,9 @@
"library": {
"gridView": "Rács nézet",
"listView": "Lista nézet",
"refresh": "Frissítés"
"refresh": "Frissítés",
"sortByStatus": "Sort by Status",
"sortByTitle": "Sort by Title"
},
"Library": "Könyvtár",
"loading": {
Expand Down
4 changes: 3 additions & 1 deletion public/locales/id/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,9 @@
"library": {
"gridView": "Tampilan bergaris",
"listView": "Tampilan daftar",
"refresh": "Segarkan"
"refresh": "Segarkan",
"sortByStatus": "Sort by Status",
"sortByTitle": "Sort by Title"
},
"Library": "Perpustakaan",
"loading": {
Expand Down
4 changes: 3 additions & 1 deletion public/locales/it/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,9 @@
"library": {
"gridView": "",
"listView": "",
"refresh": ""
"refresh": "",
"sortByStatus": "Sort by Status",
"sortByTitle": "Sort by Title"
},
"Library": "Libreria",
"loading": {
Expand Down
4 changes: 3 additions & 1 deletion public/locales/ja/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,9 @@
"library": {
"gridView": "",
"listView": "",
"refresh": ""
"refresh": "",
"sortByStatus": "Sort by Status",
"sortByTitle": "Sort by Title"
},
"Library": "ライブラリ",
"loading": {
Expand Down
4 changes: 3 additions & 1 deletion public/locales/ko/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,9 @@
"library": {
"gridView": "그리드 보기",
"listView": "목록 보기",
"refresh": "새로고침"
"refresh": "새로고침",
"sortByStatus": "Sort by Status",
"sortByTitle": "Sort by Title"
},
"Library": "라이브러리",
"loading": {
Expand Down
4 changes: 3 additions & 1 deletion public/locales/ml/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,9 @@
"library": {
"gridView": "",
"listView": "",
"refresh": ""
"refresh": "",
"sortByStatus": "Sort by Status",
"sortByTitle": "Sort by Title"
},
"Library": "കളിശാല",
"loading": {
Expand Down
4 changes: 3 additions & 1 deletion public/locales/nl/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,9 @@
"library": {
"gridView": "",
"listView": "",
"refresh": ""
"refresh": "",
"sortByStatus": "Sort by Status",
"sortByTitle": "Sort by Title"
},
"Library": "Bibliotheek",
"loading": {
Expand Down
4 changes: 3 additions & 1 deletion public/locales/pl/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,9 @@
"library": {
"gridView": "",
"listView": "",
"refresh": ""
"refresh": "",
"sortByStatus": "Sort by Status",
"sortByTitle": "Sort by Title"
},
"Library": "Biblioteka",
"loading": {
Expand Down
4 changes: 3 additions & 1 deletion public/locales/pt/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,9 @@
"library": {
"gridView": "",
"listView": "",
"refresh": ""
"refresh": "",
"sortByStatus": "Sort by Status",
"sortByTitle": "Sort by Title"
},
"Library": "Biblioteca",
"loading": {
Expand Down
4 changes: 3 additions & 1 deletion public/locales/pt_BR/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,9 @@
"library": {
"gridView": "Visualização em grade",
"listView": "Visto por último",
"refresh": "Atualizar"
"refresh": "Atualizar",
"sortByStatus": "Sort by Status",
"sortByTitle": "Sort by Title"
},
"Library": "Biblioteca",
"loading": {
Expand Down
4 changes: 3 additions & 1 deletion public/locales/ru/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,9 @@
"library": {
"gridView": "В виде сетки",
"listView": "В виде списка",
"refresh": "Обновить"
"refresh": "Обновить",
"sortByStatus": "Sort by Status",
"sortByTitle": "Sort by Title"
},
"Library": "Библиотека",
"loading": {
Expand Down
4 changes: 3 additions & 1 deletion public/locales/sv/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,9 @@
"library": {
"gridView": "",
"listView": "Listvy",
"refresh": "Uppdatera"
"refresh": "Uppdatera",
"sortByStatus": "Sort by Status",
"sortByTitle": "Sort by Title"
},
"Library": "Bibliotek",
"loading": {
Expand Down
4 changes: 3 additions & 1 deletion public/locales/ta/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,9 @@
"library": {
"gridView": "",
"listView": "",
"refresh": ""
"refresh": "",
"sortByStatus": "Sort by Status",
"sortByTitle": "Sort by Title"
},
"Library": "விளையாட்டு பட்டியல்",
"loading": {
Expand Down
4 changes: 3 additions & 1 deletion public/locales/tr/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,9 @@
"library": {
"gridView": "Izgara görünümü",
"listView": "Liste görünümü",
"refresh": "Yenile"
"refresh": "Yenile",
"sortByStatus": "Sort by Status",
"sortByTitle": "Sort by Title"
},
"Library": "Kütüphane",
"loading": {
Expand Down
4 changes: 3 additions & 1 deletion public/locales/uk/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,9 @@
"library": {
"gridView": "",
"listView": "",
"refresh": ""
"refresh": "",
"sortByStatus": "Sort by Status",
"sortByTitle": "Sort by Title"
},
"Library": "Бібліотека",
"loading": {
Expand Down
4 changes: 3 additions & 1 deletion public/locales/vi/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,9 @@
"library": {
"gridView": "Hiển thị dạng ô",
"listView": "Hiển thị dạng danh sánh",
"refresh": "Tải lại"
"refresh": "Tải lại",
"sortByStatus": "Sort by Status",
"sortByTitle": "Sort by Title"
},
"Library": "Thư viện",
"loading": {
Expand Down
4 changes: 3 additions & 1 deletion public/locales/zh_Hans/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,9 @@
"library": {
"gridView": "网格视图",
"listView": "列表视图",
"refresh": "刷新"
"refresh": "刷新",
"sortByStatus": "Sort by Status",
"sortByTitle": "Sort by Title"
},
"Library": "仓库",
"loading": {
Expand Down
4 changes: 3 additions & 1 deletion public/locales/zh_Hant/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,9 @@
"library": {
"gridView": "",
"listView": "",
"refresh": ""
"refresh": "",
"sortByStatus": "Sort by Status",
"sortByTitle": "Sort by Title"
},
"Library": "收藏庫",
"loading": {
Expand Down
Loading