Skip to content

Commit

Permalink
Change detail header text width and add scaffold for search all missi…
Browse files Browse the repository at this point in the history
…ng in applet button menu
  • Loading branch information
abayomi185 committed Sep 21, 2023
1 parent 41a8cf6 commit 2ca3160
Show file tree
Hide file tree
Showing 9 changed files with 83 additions and 8 deletions.
2 changes: 1 addition & 1 deletion applets/jellyfin/components/useHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export const useJellyfinDetailHeader = (
justifyContent="flex-end"
>
<XStack
width="55%"
width="50%"
height="$4"
alignItems="center"
justifyContent="center"
Expand Down
2 changes: 1 addition & 1 deletion applets/radarr/components/useHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export const useRadarrDetailHeader = (
justifyContent="flex-end"
>
<XStack
width="55%"
width="50%"
height="$4"
alignItems="center"
justifyContent="center"
Expand Down
8 changes: 8 additions & 0 deletions applets/radarr/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ export const RadarrContextMenuOptions: ContextMenuOptions = {
systemIcon: "x.circle",
destructive: true,
},
{
index: 1,
title: `${t("radarr:searchAllMissing")}`,
systemIcon: "magnifyingglass.circle",
},
];
},
getContextHandler(indexPath: number[]): void {
Expand All @@ -29,6 +34,9 @@ export const RadarrContextMenuOptions: ContextMenuOptions = {
});
useAppStateStore.setState({ activeApplet: undefined });
break;
case 1:
console.log("Search all missing");
break;
}
},
};
32 changes: 31 additions & 1 deletion applets/radarr/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,13 @@ import {
RadarrDetailScreenProps,
RadarrSearchFilterContext,
} from "./types";
import { HistoryResource, MovieResource, MovieStatusType } from "./api";
import {
CommandResource,
HistoryResource,
MovieResource,
MovieStatusType,
postApiV3Command,
} from "./api";
import { useColorScheme } from "@astrysk/utils";
import { FlashList } from "@shopify/flash-list";

Expand Down Expand Up @@ -357,3 +363,27 @@ export const expandableItemAnimationHandler = <T>(
},
});
};

// NOTE: SEARCH ALL MISSING
export const searchAllMissing = () => {
// id?: number;
// name?: string | null;
// commandName?: string | null;
// message?: string | null;
// body?: Command;
// priority?: CommandPriority;
// status?: CommandStatus;
// result?: CommandResult;
// queued?: string;
// started?: string | null;
// ended?: string | null;
// duration?: TimeSpan;
// exception?: string | null;
// trigger?: CommandTrigger;
// clientUserAgent?: string | null;
// stateChangeTime?: string | null;
// sendUpdatesToClient?: boolean;
// updateScheduledTask?: boolean;
// lastExecutionTime?: string | null;
postApiV3Command({});
};
2 changes: 1 addition & 1 deletion applets/sonarr/components/useHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export const useSonarrDetailHeader = (
justifyContent="flex-end"
>
<XStack
width="55%"
width="50%"
height="$4"
alignItems="center"
justifyContent="center"
Expand Down
8 changes: 8 additions & 0 deletions applets/sonarr/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ export const SonarrContextMenuOptions: ContextMenuOptions = {
systemIcon: "x.circle",
destructive: true,
},
{
index: 1,
title: `${t("radarr:searchAllMissing")}`,
systemIcon: "magnifyingglass.circle",
},
];
},
getContextHandler(indexPath: number[]): void {
Expand All @@ -29,6 +34,9 @@ export const SonarrContextMenuOptions: ContextMenuOptions = {
});
useAppStateStore.setState({ activeApplet: undefined });
break;
case 1:
console.log("Search all missing");
break;
}
},
};
31 changes: 30 additions & 1 deletion applets/sonarr/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@ import {
SonarrDetailScreenProps,
SonarrSearchFilterContext,
} from "./types";
import { HistoryResource, SeriesResource, SeriesStatusType } from "./api";
import {
HistoryResource,
SeriesResource,
SeriesStatusType,
postApiV3Command,
} from "./api";
import { useColorScheme } from "@astrysk/utils";
import { FlashList } from "@shopify/flash-list";

Expand Down Expand Up @@ -338,3 +343,27 @@ export const expandableItemAnimationHandler = <T>(
},
});
};

// NOTE: SEARCH ALL MISSING
export const searchAllMissing = () => {
// id?: number;
// name?: string | null;
// commandName?: string | null;
// message?: string | null;
// body?: Command;
// priority?: CommandPriority;
// status?: CommandStatus;
// result?: CommandResult;
// queued?: string;
// started?: string | null;
// ended?: string | null;
// duration?: TimeSpan;
// exception?: string | null;
// trigger?: CommandTrigger;
// clientUserAgent?: string | null;
// stateChangeTime?: string | null;
// sendUpdatesToClient?: boolean;
// updateScheduledTask?: boolean;
// lastExecutionTime?: string | null;
postApiV3Command({});
};
4 changes: 2 additions & 2 deletions locales/en/radarr.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"movieDetail": "Movie Detail",
"movieDescription": "Movie Description",
"noDescriptionAvailable": "No description available",

"history": "History",
"interactiveSearch": "Interactive Search",
"editMovie": "Edit Movie",
Expand Down Expand Up @@ -83,13 +83,13 @@
"noDataFound": "No Data Found",
"noCalendarDataFound": "No Calendar Data Found",
"noCalendarDataFoundForThisWeek": "No Calendar Data Found For This Week",
"noDataFound": "No Data Found",
"noMovieFound": "No Movie Found",
"doYouWantToDelete": "Do you want to delete?",
"thisHas": "This has",
"deleteCache": "Delete Cache",
"deleteCacheMessage": "This action will delete all media cache. Are you sure?",
"searchAll": "Search All",
"searchAllMissing": "Search All Missing",

"unknown": "Unknown",
"grabbed": "Grabbed",
Expand Down
2 changes: 1 addition & 1 deletion locales/en/sonarr.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,13 @@
"noDataFound": "No Data Found",
"noCalendarDataFound": "No Calendar Data Found",
"noCalendarDataFoundForThisWeek": "No Calendar Data Found For This Week",
"noDataFound": "No Data Found",
"noSeriesFound": "No Series Found",
"doYouWantToDelete": "Do you want to delete?",
"thisHas": "This has",
"deleteCache": "Delete Cache",
"deleteCacheMessage": "This action will delete all media cache. Are you sure?",
"searchAll": "Search All",
"searchAllMissing": "Search All Missing",

"unknown": "Unknown",
"grabbed": "Grabbed",
Expand Down

0 comments on commit 2ca3160

Please sign in to comment.