mirror of
https://github.com/Radarr/Radarr
synced 2025-12-29 03:38:44 +01:00
26 lines
448 B
JavaScript
26 lines
448 B
JavaScript
/* eslint max-params: 0 */
|
|
import moment from 'moment';
|
|
|
|
function getStatusStyle(hasFile, downloading, startTime, isMonitored) {
|
|
const currentTime = moment();
|
|
|
|
if (hasFile) {
|
|
return 'downloaded';
|
|
}
|
|
|
|
if (downloading) {
|
|
return 'downloading';
|
|
}
|
|
|
|
if (!isMonitored) {
|
|
return 'unmonitored';
|
|
}
|
|
|
|
if (startTime.isBefore(currentTime) && !hasFile) {
|
|
return 'missing';
|
|
}
|
|
|
|
return 'unaired';
|
|
}
|
|
|
|
export default getStatusStyle;
|