mirror of
https://github.com/Sonarr/Sonarr.git
synced 2026-04-22 22:16:13 -04:00
Convert Episode and Season search to TypeScript
Co-authored-by: Mark McDowall <markus.mcd5@gmail.com>
This commit is contained in:
@@ -1,6 +1,19 @@
|
||||
import { createSelector } from 'reselect';
|
||||
import AppState from 'App/State/AppState';
|
||||
|
||||
export function createQueueItemSelectorForHook(episodeId: number) {
|
||||
return createSelector(
|
||||
(state: AppState) => state.queue.details.items,
|
||||
(details) => {
|
||||
if (!episodeId || !details) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return details.find((item) => item.episodeId === episodeId);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
function createQueueItemSelector() {
|
||||
return createSelector(
|
||||
(_: AppState, { episodeId }: { episodeId: number }) => episodeId,
|
||||
|
||||
Reference in New Issue
Block a user