+
Filename
@@ -118,7 +112,7 @@ function UnrecognizedTab(props: Props) {
{importFolder}
-
+
Import Date
{moment(selectedFileInfo.Created).format('MMMM DD YYYY, HH:mm')}
@@ -140,128 +134,125 @@ function UnrecognizedTab(props: Props) {
{selectedFileInfo.Hashes.SHA1}
-
+
CRC32
{selectedFileInfo.Hashes.CRC32}
-
+
);
};
const renderPanelOptions = () => (
);
const rescanFiles = (selected = false) => {
if (selected) {
- const fileIds = Object.keys(pickBy(markedItems, item => item));
- forEach(fileIds, fileId => dispatch({ type: Events.UTILITIES_RESCAN, payload: fileId }));
+ forEach(markedItems, (marked, fileId) => {
+ if (marked) fileRescanTrigger(parseInt(fileId)).catch(() => {});
+ });
} else {
- forEach(files, file => dispatch({ type: Events.UTILITIES_RESCAN, payload: file.ID }));
+ forEach(files.data?.List, file => fileRescanTrigger(file.ID));
}
};
const rehashFiles = (selected = false) => {
if (selected) {
- const fileIds = Object.keys(pickBy(markedItems, item => item));
- forEach(fileIds, fileId => dispatch({ type: Events.UTILITIES_REHASH, payload: fileId }));
+ forEach(markedItems, (marked, fileId) => {
+ if (marked) fileRehashTrigger(parseInt(fileId)).catch(() => {});
+ });
} else {
- forEach(files, file => dispatch({ type: Events.UTILITIES_REHASH, payload: file.ID }));
+ forEach(files.data?.List, file => fileRehashTrigger(file.ID));
}
};
- const renderCommonOperations = () => (
-
-
-
-
-
- );
+ const cancelSelection = () => {
+ const tempMarkedItems = markedItems;
+ forEach(tempMarkedItems, (_, key) => {
+ tempMarkedItems[key] = false;
+ });
+ changeMarkedItems(tempMarkedItems);
+ };
- const renderOperations = () => (
-
-
-
-
- );
+ );
+
+ return (
+
+ {common ? (
+ <>
+ {renderButton(() => files.refetch(), mdiRestart, 'Refresh')}
+ {renderButton(() => rescanFiles(), mdiDatabaseSearchOutline, 'Rescan All')}
+ {renderButton(() => rehashFiles(), mdiDatabaseSyncOutline, 'Rehash All')}
+ {renderButton(() => {}, mdiDumpTruck, 'AVDump All')}
+ >
+ ) : (
+ <>
+ {renderButton(() => setManualLink(!manualLink), mdiLinkVariantPlus, 'Manually Link')}
+ {renderButton(() => rescanFiles(true), mdiDatabaseSearchOutline, 'Rescan')}
+ {renderButton(() => rehashFiles(true), mdiDatabaseSyncOutline, 'Rehash')}
+ {renderButton(() => {}, mdiDumpTruck, 'AVDump')}
+ {renderButton(() => {}, mdiEyeOffOutline, 'Ignore')}
+ {renderButton(() => {}, mdiMinusCircleOutline, 'Delete')}
+ {renderButton(() => cancelSelection(), mdiCloseCircleOutline, 'Cancel Selection')}
+ >
+ )}
+
+ );
+ };
+
+ const updateSelectedSeries = (series: SeriesAniDBSearchResult) => setSelectedSeries(series);
return (
-
-
-
- {markedItemsCount > 0 ? renderOperations() : renderCommonOperations()}
-
{markedItemsCount} Files Selected
-
-
-
-
-
- {/*TODO: Select all checkbox*/}
- |
- Import Folder |
- Filename |
- Size |
- Date |
-
-
-
- {rows}
-
-
+
+
{}} />
+
+ {renderOperations(markedItemsCount === 0)}
+
{markedItemsCount} Files Selected
+
+ {manualLink && (
+
+ {
+ setManualLink(false);
+ setSelectedSeries({} as SeriesAniDBSearchResult);
+ }} className="px-3 py-2 bg-background-alt rounded-md border !border-background-border">Cancel
+ {}} className="px-3 py-2 bg-highlight-1 rounded-md border !border-background-border ml-2">Save
+
+ )}
+ {manualLink ? (
+
+ markedItems[item.ID])!} selectedSeries={selectedSeries} />
+ {selectedSeries?.ID
+ ? ()
+ : ()}
+
+ ) : (
+
+ )}
-
+
{markedItemsCount === 0 ? (
-
+
No File(s) Selected
-
+
) : renderFileInfo()}
diff --git a/src/pages/utilities/UtilitiesPage.tsx b/src/pages/utilities/UtilitiesPage.tsx
index dba8e5247..200971914 100644
--- a/src/pages/utilities/UtilitiesPage.tsx
+++ b/src/pages/utilities/UtilitiesPage.tsx
@@ -1,11 +1,10 @@
import React from 'react';
-
-import UnrecognizedUtility from './UnrecognizedUtility';
+import { Outlet } from 'react-router';
function UtilitiesPage() {
return (
-
+
);
}