New: Add icon for deleted episodes with status missing from disk

Signed-off-by: Stevie Robinson <stevie.robinson@gmail.com>
(cherry picked from commit 79907c881cc92ce9ee3973d5cf21749fe5fc58da)

Closes #4451
pull/4470/head
Stevie Robinson 4 months ago committed by Bogdan
parent 9aae065c5d
commit 1dcc8b5850

@ -3,9 +3,10 @@ import React from 'react';
import Icon from 'Components/Icon'; import Icon from 'Components/Icon';
import TableRowCell from 'Components/Table/Cells/TableRowCell'; import TableRowCell from 'Components/Table/Cells/TableRowCell';
import { icons, kinds } from 'Helpers/Props'; import { icons, kinds } from 'Helpers/Props';
import translate from 'Utilities/String/translate';
import styles from './HistoryEventTypeCell.css'; import styles from './HistoryEventTypeCell.css';
function getIconName(eventType) { function getIconName(eventType, data) {
switch (eventType) { switch (eventType) {
case 'grabbed': case 'grabbed':
return icons.DOWNLOADING; return icons.DOWNLOADING;
@ -16,7 +17,7 @@ function getIconName(eventType) {
case 'downloadFailed': case 'downloadFailed':
return icons.DOWNLOADING; return icons.DOWNLOADING;
case 'trackFileDeleted': case 'trackFileDeleted':
return icons.DELETE; return data.reason === 'MissingFromDisk' ? icons.FILE_MISSING : icons.DELETE;
case 'trackFileRenamed': case 'trackFileRenamed':
return icons.ORGANIZE; return icons.ORGANIZE;
case 'trackFileRetagged': case 'trackFileRetagged':
@ -54,11 +55,11 @@ function getTooltip(eventType, data) {
case 'downloadFailed': case 'downloadFailed':
return 'Album download failed'; return 'Album download failed';
case 'trackFileDeleted': case 'trackFileDeleted':
return 'Track file deleted'; return data.reason === 'MissingFromDisk' ? translate('TrackFileMissingTooltip') : translate('TrackFileDeletedTooltip');
case 'trackFileRenamed': case 'trackFileRenamed':
return 'Track file renamed'; return translate('TrackFileRenamedTooltip');
case 'trackFileRetagged': case 'trackFileRetagged':
return 'Track file tags updated'; return translate('TrackFileTagsUpdatedTooltip');
case 'albumImportIncomplete': case 'albumImportIncomplete':
return 'Files downloaded but not all could be imported'; return 'Files downloaded but not all could be imported';
case 'downloadImported': case 'downloadImported':
@ -71,7 +72,7 @@ function getTooltip(eventType, data) {
} }
function HistoryEventTypeCell({ eventType, data }) { function HistoryEventTypeCell({ eventType, data }) {
const iconName = getIconName(eventType); const iconName = getIconName(eventType, data);
const iconKind = getIconKind(eventType); const iconKind = getIconKind(eventType);
const tooltip = getTooltip(eventType, data); const tooltip = getTooltip(eventType, data);

@ -55,6 +55,7 @@ import {
faEye as fasEye, faEye as fasEye,
faFastBackward as fasFastBackward, faFastBackward as fasFastBackward,
faFastForward as fasFastForward, faFastForward as fasFastForward,
faFileCircleQuestion as fasFileCircleQuestion,
faFileExport as fasFileExport, faFileExport as fasFileExport,
faFileImport as fasFileImport, faFileImport as fasFileImport,
faFileInvoice as farFileInvoice, faFileInvoice as farFileInvoice,
@ -154,7 +155,8 @@ export const EXPORT = fasFileExport;
export const EXTERNAL_LINK = fasExternalLinkAlt; export const EXTERNAL_LINK = fasExternalLinkAlt;
export const FATAL = fasTimesCircle; export const FATAL = fasTimesCircle;
export const FILE = farFile; export const FILE = farFile;
export const FILEIMPORT = fasFileImport; export const FILE_IMPORT = fasFileImport;
export const FILE_MISSING = fasFileCircleQuestion;
export const FILTER = fasFilter; export const FILTER = fasFilter;
export const FOLDER = farFolder; export const FOLDER = farFolder;
export const FOLDER_OPEN = fasFolderOpen; export const FOLDER_OPEN = fasFolderOpen;

@ -51,11 +51,11 @@ class SelectTrackRow extends Component {
iconKind = kinds.DEFAULT; iconKind = kinds.DEFAULT;
iconTip = 'Track missing from library and no import selected.'; iconTip = 'Track missing from library and no import selected.';
} else if (importSelected && hasFile) { } else if (importSelected && hasFile) {
iconName = icons.FILEIMPORT; iconName = icons.FILE_IMPORT;
iconKind = kinds.WARNING; iconKind = kinds.WARNING;
iconTip = 'Warning: Existing track will be replaced by download.'; iconTip = 'Warning: Existing track will be replaced by download.';
} else if (importSelected && !hasFile) { } else if (importSelected && !hasFile) {
iconName = icons.FILEIMPORT; iconName = icons.FILE_IMPORT;
iconKind = kinds.DEFAULT; iconKind = kinds.DEFAULT;
iconTip = 'Track missing from library and selected for import.'; iconTip = 'Track missing from library and selected for import.';
} }

@ -1069,6 +1069,10 @@
"TrackCount": "Track Count", "TrackCount": "Track Count",
"TrackDownloaded": "Track Downloaded", "TrackDownloaded": "Track Downloaded",
"TrackFileCounttotalTrackCountTracksDownloadedInterp": "{0}/{1} tracks downloaded", "TrackFileCounttotalTrackCountTracksDownloadedInterp": "{0}/{1} tracks downloaded",
"TrackFileDeletedTooltip": "Track file deleted",
"TrackFileMissingTooltip": "Track file missing",
"TrackFileRenamedTooltip": "Track file renamed",
"TrackFileTagsUpdatedTooltip": "Track file tags updated",
"TrackFiles": "Track Files", "TrackFiles": "Track Files",
"TrackFilesCountMessage": "No track files", "TrackFilesCountMessage": "No track files",
"TrackFilesLoadError": "Unable to load track files", "TrackFilesLoadError": "Unable to load track files",

Loading…
Cancel
Save