|
|
@ -10,10 +10,10 @@ function monitorSeasons(seasons, startingSeason) {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function getMonitoringOptions(seasons, monitor) {
|
|
|
|
function getMonitoringOptions(albums, monitor) {
|
|
|
|
if (!seasons.length) {
|
|
|
|
if (!albums.length) {
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
seasons: [],
|
|
|
|
albums: [],
|
|
|
|
options: {
|
|
|
|
options: {
|
|
|
|
ignoreEpisodesWithFiles: false,
|
|
|
|
ignoreEpisodesWithFiles: false,
|
|
|
|
ignoreEpisodesWithoutFiles: false
|
|
|
|
ignoreEpisodesWithoutFiles: false
|
|
|
@ -21,10 +21,10 @@ function getMonitoringOptions(seasons, monitor) {
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const firstSeason = _.minBy(_.reject(seasons, { seasonNumber: 0 }), 'seasonNumber').seasonNumber;
|
|
|
|
const firstSeason = _.minBy(_.reject(albums, { seasonNumber: 0 }), 'seasonNumber').seasonNumber;
|
|
|
|
const lastSeason = _.maxBy(seasons, 'seasonNumber').seasonNumber;
|
|
|
|
const lastSeason = _.maxBy(albums, 'seasonNumber').seasonNumber;
|
|
|
|
|
|
|
|
|
|
|
|
monitorSeasons(seasons, firstSeason);
|
|
|
|
monitorSeasons(albums, firstSeason);
|
|
|
|
|
|
|
|
|
|
|
|
const monitoringOptions = {
|
|
|
|
const monitoringOptions = {
|
|
|
|
ignoreEpisodesWithFiles: false,
|
|
|
|
ignoreEpisodesWithFiles: false,
|
|
|
@ -37,11 +37,11 @@ function getMonitoringOptions(seasons, monitor) {
|
|
|
|
monitoringOptions.ignoreEpisodesWithoutFiles = true;
|
|
|
|
monitoringOptions.ignoreEpisodesWithoutFiles = true;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 'latest':
|
|
|
|
case 'latest':
|
|
|
|
monitorSeasons(seasons, lastSeason);
|
|
|
|
monitorSeasons(albums, lastSeason);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 'first':
|
|
|
|
case 'first':
|
|
|
|
monitorSeasons(seasons, lastSeason + 1);
|
|
|
|
monitorSeasons(albums, lastSeason + 1);
|
|
|
|
_.find(seasons, { seasonNumber: firstSeason }).monitored = true;
|
|
|
|
_.find(albums, { seasonNumber: firstSeason }).monitored = true;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 'missing':
|
|
|
|
case 'missing':
|
|
|
|
monitoringOptions.ignoreEpisodesWithFiles = true;
|
|
|
|
monitoringOptions.ignoreEpisodesWithFiles = true;
|
|
|
@ -50,14 +50,14 @@ function getMonitoringOptions(seasons, monitor) {
|
|
|
|
monitoringOptions.ignoreEpisodesWithoutFiles = true;
|
|
|
|
monitoringOptions.ignoreEpisodesWithoutFiles = true;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 'none':
|
|
|
|
case 'none':
|
|
|
|
monitorSeasons(seasons, lastSeason + 1);
|
|
|
|
monitorSeasons(albums, lastSeason + 1);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
seasons: _.map(seasons, (season) => {
|
|
|
|
seasons: _.map(albums, (season) => {
|
|
|
|
return _.pick(season, [
|
|
|
|
return _.pick(season, [
|
|
|
|
'seasonNumber',
|
|
|
|
'seasonNumber',
|
|
|
|
'monitored'
|
|
|
|
'monitored'
|
|
|
|