Skip to content

Commit 6c5cbc0

Browse files
authored
Added sorting/filters to the downloads page (#53)
* version bump * added sorting order/Search to Downloadspage - you can now change the order in which items are sorted on the downloadspage (Date, Name, Size, Type Series/Movie) - there is also a button to change the visibility of video files that have no metadata in the app - added a search feature to filter your downloaded files - added info about the ctrl+k shortcut which opens search in settings and on the downloadspage to the keyboard shortcuts modal * downloads order is now persistant - the sorting order you chose on the downloadspage is now persistent over app-restarts - performance optimizations on downloadspage
1 parent 1cd1fc8 commit 6c5cbc0

5 files changed

Lines changed: 492 additions & 44 deletions

File tree

src/App.jsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ export default function App() {
4040
const [page, setPage] = useState(() => storage.get("startPage") || "home");
4141
const [selected, setSelected] = useState(null);
4242
const [showSearch, setShowSearch] = useState(false);
43+
const [dlSearchOpen, setDlSearchOpen] = useState(false);
4344
const [librarySort, setLibrarySort] = useState(
4445
() => storage.get(STORAGE_KEYS.LIBRARY_SORT) || "manual",
4546
);
@@ -575,6 +576,12 @@ export default function App() {
575576
e.preventDefault();
576577
setShowSearch(true);
577578
}
579+
if ((e.metaKey || e.ctrlKey) && e.key === "k") {
580+
if (pageRef.current === "downloads") {
581+
e.preventDefault();
582+
setDlSearchOpen(true);
583+
}
584+
}
578585
if (e.key === "Escape") {
579586
setShowSearch(false);
580587
setShowShortcuts(false);
@@ -966,6 +973,8 @@ export default function App() {
966973
highlightId={highlightDownload}
967974
onClearHighlight={() => setHighlightDownload(null)}
968975
onSelect={handleSelectResult}
976+
searchOpen={dlSearchOpen}
977+
onSearchClose={() => setDlSearchOpen(false)}
969978
onSettings={(section) =>
970979
navigate("settings", { section: section || null })
971980
}

src/components/KeyboardShortcutsModal.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
export default function KeyboardShortcutsModal({ onClose }) {
33
const shortcuts = [
44
{ keys: ["Ctrl", "F"], desc: "Open search" },
5+
{ keys: ["Ctrl", "K"], desc: "Search on a page" },
56
{ keys: ["Esc"], desc: "Close search / modal" },
67
{ keys: ["Ctrl", "Z"], desc: "Navigate back" },
78
{ keys: ["Ctrl", "R"], desc: "Reload app" },

0 commit comments

Comments
 (0)