diff --git a/NzbDrone.Core/Datastore/TableMapping.cs b/NzbDrone.Core/Datastore/TableMapping.cs index 37ec92fa8..55015eb00 100644 --- a/NzbDrone.Core/Datastore/TableMapping.cs +++ b/NzbDrone.Core/Datastore/TableMapping.cs @@ -49,6 +49,7 @@ public static void Map() Mapper.Entity().RegisterModel("Episodes") .Ignore(e => e.SeriesTitle) + .Ignore(e => e.HasFile) .Relationship() .HasOne(episode => episode.EpisodeFile, episode => episode.EpisodeFileId); diff --git a/NzbDrone.Core/Tv/Episode.cs b/NzbDrone.Core/Tv/Episode.cs index e2a3fe922..b593579b7 100644 --- a/NzbDrone.Core/Tv/Episode.cs +++ b/NzbDrone.Core/Tv/Episode.cs @@ -26,5 +26,9 @@ public class Episode : ModelBase public LazyLoaded EpisodeFile { get; set; } + public Boolean HasFile + { + get { return EpisodeFileId > 0; } + } } } \ No newline at end of file diff --git a/UI/Calendar/calendar.less b/UI/Calendar/calendar.less index 77fbf7047..3c4aa8816 100644 --- a/UI/Calendar/calendar.less +++ b/UI/Calendar/calendar.less @@ -8,11 +8,6 @@ border-color : #eeeeee; } - .primary { - border-color : #007ccd; - background-color : #007ccd; - } - .fc-event-skin { background-color : #007ccd; border : 1px solid #007ccd; @@ -24,6 +19,11 @@ .clickable; } + .primary { + border-color : #007ccd; + background-color : #007ccd; + } + .info { border-color : #14b8d4; background-color : #14b8d4; @@ -69,37 +69,17 @@ border-top : 1px solid #eeeeee; padding-top : 10px; - .primary { - border-color : #007ccd; - } - - .info { - border-color : #14b8d4; - } - h4 { font-weight : 500; color : #008dcd; margin : 5px 0px; } - .inverse { - border-color : #333333; - } - - .warning { - border-color : #ffa93c; - } - p { color : #999999; margin: 0px; } - .danger { - border-color : #ea494a; - } - .date { text-align : center; display : inline-block; @@ -121,6 +101,32 @@ } } + .episode-title { + .btn-link; + color: @linkColor; + margin-top: 1px; + } + + .primary { + border-color : #007ccd; + } + + .info { + border-color : #14b8d4; + } + + .inverse { + border-color : #333333; + } + + .warning { + border-color : #ffa93c; + } + + .danger { + border-color : #ea494a; + } + .purple { border-color : #7932ea; } @@ -128,10 +134,4 @@ .success { border-color : #4cb158; } - - .episode-title { - .btn-link; - color: @linkColor; - margin-top: 1px; - } } diff --git a/UI/Series/EpisodeModel.js b/UI/Series/EpisodeModel.js index 0c39df28d..7e3edb9bf 100644 --- a/UI/Series/EpisodeModel.js +++ b/UI/Series/EpisodeModel.js @@ -29,7 +29,7 @@ define( if (this.has('series')) { var start = Date.create(this.get('airDate')); - var runtime = this.get('series').runtime; + var runtime = this.get('series').get('runtime'); return start.addMinutes(runtime); } @@ -37,20 +37,23 @@ define( return undefined; }, statusLevel : function () { - var episodeFileId = this.get('episodeFileId'); + var hasFile = this.get('hasFile'); var currentTime = Date.create(); var start = Date.create(this.get('airDate')); var end = Date.create(this.get('end')); + console.log(this.get('end')); + + if (currentTime.isBetween(start, end)) { return 'warning'; } - if (start.isBefore(currentTime) && episodeFileId === 0) { + if (start.isBefore(currentTime) && !hasFile) { return 'danger'; } - if (status === 'Ready') { + if (hasFile) { return 'success'; }