From 9efee65966ee1a82abee89db92e67c52869fe3d3 Mon Sep 17 00:00:00 2001 From: Keivan Beigi Date: Mon, 22 Apr 2013 17:44:47 -0700 Subject: [PATCH] minor cleanup --- .../Datastore/{ => Converters}/EnumIntConverter.cs | 2 +- NzbDrone.Core/Datastore/IReadModels.cs | 8 ++++++++ NzbDrone.Core/Datastore/IWriteModels.cs | 9 +++++++++ .../Search/DailyEpisodeMatchSpecification.cs | 2 -- NzbDrone.Core/NzbDrone.Core.csproj | 4 +++- NzbDrone.Core/Tv/Episode.cs | 2 -- UI/Series/Details/EpisodeItemView.js | 4 ++-- UI/Series/Details/SeriesDetailsView.js | 3 ++- 8 files changed, 25 insertions(+), 9 deletions(-) rename NzbDrone.Core/Datastore/{ => Converters}/EnumIntConverter.cs (94%) create mode 100644 NzbDrone.Core/Datastore/IReadModels.cs create mode 100644 NzbDrone.Core/Datastore/IWriteModels.cs diff --git a/NzbDrone.Core/Datastore/EnumIntConverter.cs b/NzbDrone.Core/Datastore/Converters/EnumIntConverter.cs similarity index 94% rename from NzbDrone.Core/Datastore/EnumIntConverter.cs rename to NzbDrone.Core/Datastore/Converters/EnumIntConverter.cs index 7765fe0e0..f79c736c2 100644 --- a/NzbDrone.Core/Datastore/EnumIntConverter.cs +++ b/NzbDrone.Core/Datastore/Converters/EnumIntConverter.cs @@ -2,7 +2,7 @@ using Marr.Data.Converters; using Marr.Data.Mapping; -namespace NzbDrone.Core.Datastore +namespace NzbDrone.Core.Datastore.Converters { public class EnumIntConverter : IConverter { diff --git a/NzbDrone.Core/Datastore/IReadModels.cs b/NzbDrone.Core/Datastore/IReadModels.cs new file mode 100644 index 000000000..6a8a6023d --- /dev/null +++ b/NzbDrone.Core/Datastore/IReadModels.cs @@ -0,0 +1,8 @@ +namespace NzbDrone.Core.Datastore +{ + public interface IReadModels where T : ModelBase + { + T All(); + T Get(int id); + } +} \ No newline at end of file diff --git a/NzbDrone.Core/Datastore/IWriteModels.cs b/NzbDrone.Core/Datastore/IWriteModels.cs new file mode 100644 index 000000000..f3608f16a --- /dev/null +++ b/NzbDrone.Core/Datastore/IWriteModels.cs @@ -0,0 +1,9 @@ +namespace NzbDrone.Core.Datastore +{ + public interface IWriteModels where T : ModelBase + { + T Add(T model); + T Update(T model); + void Delete(int id); + } +} \ No newline at end of file diff --git a/NzbDrone.Core/DecisionEngine/Specifications/Search/DailyEpisodeMatchSpecification.cs b/NzbDrone.Core/DecisionEngine/Specifications/Search/DailyEpisodeMatchSpecification.cs index 2ff1f60d5..89075885a 100644 --- a/NzbDrone.Core/DecisionEngine/Specifications/Search/DailyEpisodeMatchSpecification.cs +++ b/NzbDrone.Core/DecisionEngine/Specifications/Search/DailyEpisodeMatchSpecification.cs @@ -1,7 +1,5 @@ using NLog; using NzbDrone.Core.IndexerSearch.Definitions; -using NzbDrone.Core.Model; -using NzbDrone.Core.Parser; using NzbDrone.Core.Parser.Model; using NzbDrone.Core.Tv; diff --git a/NzbDrone.Core/NzbDrone.Core.csproj b/NzbDrone.Core/NzbDrone.Core.csproj index d6cd4f9f1..e7fb4328e 100644 --- a/NzbDrone.Core/NzbDrone.Core.csproj +++ b/NzbDrone.Core/NzbDrone.Core.csproj @@ -192,8 +192,10 @@ - + + + diff --git a/NzbDrone.Core/Tv/Episode.cs b/NzbDrone.Core/Tv/Episode.cs index 3b78a281c..5e1da65f8 100644 --- a/NzbDrone.Core/Tv/Episode.cs +++ b/NzbDrone.Core/Tv/Episode.cs @@ -22,8 +22,6 @@ public class Episode : ModelBase public Nullable AbsoluteEpisodeNumber { get; set; } public int SceneSeasonNumber { get; set; } public int SceneEpisodeNumber { get; set; } - - //Todo: This should be UTC public DateTime? GrabDate { get; set; } public bool HasFile diff --git a/UI/Series/Details/EpisodeItemView.js b/UI/Series/Details/EpisodeItemView.js index 69828b905..e0ce02211 100644 --- a/UI/Series/Details/EpisodeItemView.js +++ b/UI/Series/Details/EpisodeItemView.js @@ -9,8 +9,8 @@ define(['app', 'Series/SeasonModel'], function () { }, - events : { + events: { - }, + } }); }); diff --git a/UI/Series/Details/SeriesDetailsView.js b/UI/Series/Details/SeriesDetailsView.js index 22513e429..72dfe869d 100644 --- a/UI/Series/Details/SeriesDetailsView.js +++ b/UI/Series/Details/SeriesDetailsView.js @@ -1,3 +1,4 @@ +"use strict"; define(['app', 'Quality/QualityProfileCollection', 'Series/Details/SeasonCompositeView', 'Series/SeasonCollection'], function () { NzbDrone.Series.Details.SeriesDetailsView = Backbone.Marionette.CompositeView.extend({ @@ -10,4 +11,4 @@ define(['app', 'Quality/QualityProfileCollection', 'Series/Details/SeasonComposi this.collection.fetch({data: { seriesId: this.model.get('id') }}); } }); -}); \ No newline at end of file +});