Lidarr/frontend/src/Calendar/getStatusStyle.js

27 lines
453 B
JavaScript
Raw Normal View History

2017-10-07 06:21:06 +00:00
/* eslint max-params: 0 */
2017-09-04 02:20:56 +00:00
import moment from 'moment';
function getStatusStyle(episodeNumber, downloading, startTime, isMonitored) {
2017-09-04 02:20:56 +00:00
const currentTime = moment();
// if (hasFile) {
// return 'downloaded';
// }
2017-09-04 02:20:56 +00:00
if (downloading) {
return 'downloading';
}
if (!isMonitored) {
return 'unmonitored';
}
if (currentTime.isAfter(startTime)) {
2017-09-04 02:20:56 +00:00
return 'missing';
}
2017-09-16 20:22:06 +00:00
return 'unreleased';
2017-09-04 02:20:56 +00:00
}
export default getStatusStyle;