2017-10-07 06:21:06 +00:00
|
|
|
/* eslint max-params: 0 */
|
2017-09-04 02:20:56 +00:00
|
|
|
import moment from 'moment';
|
|
|
|
|
2017-09-16 04:16:26 +00:00
|
|
|
function getStatusStyle(episodeNumber, downloading, startTime, isMonitored) {
|
2017-09-04 02:20:56 +00:00
|
|
|
const currentTime = moment();
|
|
|
|
|
2017-09-16 04:16:26 +00:00
|
|
|
// if (hasFile) {
|
|
|
|
// return 'downloaded';
|
|
|
|
// }
|
2017-09-04 02:20:56 +00:00
|
|
|
|
|
|
|
if (downloading) {
|
|
|
|
return 'downloading';
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!isMonitored) {
|
|
|
|
return 'unmonitored';
|
|
|
|
}
|
|
|
|
|
2017-09-08 03:09:52 +00:00
|
|
|
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;
|