You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
533 B
31 lines
533 B
/* eslint max-params: 0 */
|
|
import moment from 'moment';
|
|
|
|
function getStatusStyle(episodeNumber, downloading, startTime, isMonitored, percentOfTracks) {
|
|
const currentTime = moment();
|
|
|
|
if (percentOfTracks === 100) {
|
|
return 'downloaded';
|
|
}
|
|
|
|
if (percentOfTracks > 0) {
|
|
return 'partial';
|
|
}
|
|
|
|
if (downloading) {
|
|
return 'downloading';
|
|
}
|
|
|
|
if (!isMonitored) {
|
|
return 'unmonitored';
|
|
}
|
|
|
|
if (currentTime.isAfter(startTime)) {
|
|
return 'missing';
|
|
}
|
|
|
|
return 'unreleased';
|
|
}
|
|
|
|
export default getStatusStyle;
|