1
0
Fork 0
mirror of https://github.com/Sonarr/Sonarr synced 2024-12-30 19:56:54 +00:00

SceneMapping uses new API endpoint

This commit is contained in:
Mark McDowall 2013-09-05 23:25:34 -07:00
parent a39125eb6c
commit e07b588fd8
3 changed files with 4 additions and 7 deletions

View file

@ -5,15 +5,15 @@ namespace NzbDrone.Core.DataAugmentation.Scene
{ {
public class SceneMapping : ModelBase public class SceneMapping : ModelBase
{ {
[JsonProperty("CleanTitle")] [JsonProperty("title")]
public string ParseTerm { get; set; } public string ParseTerm { get; set; }
[JsonProperty("Title")] [JsonProperty("searchTitle")]
public string SearchTerm { get; set; } public string SearchTerm { get; set; }
[JsonProperty("Id")]
public int TvdbId { get; set; } public int TvdbId { get; set; }
[JsonProperty("season")]
public int SeasonNumber { get; set; } public int SeasonNumber { get; set; }
} }
} }

View file

@ -21,7 +21,7 @@ namespace NzbDrone.Core.DataAugmentation.Scene
public List<SceneMapping> Fetch() public List<SceneMapping> Fetch()
{ {
var mappingsJson = _httpProvider.DownloadString(Services.RootUrl + "/SceneMapping/Active"); var mappingsJson = _httpProvider.DownloadString(Services.RootUrl + "/v1/SceneMapping");
return Json.Deserialize<List<SceneMapping>>(mappingsJson); return Json.Deserialize<List<SceneMapping>>(mappingsJson);
} }
} }

View file

@ -44,7 +44,6 @@ namespace NzbDrone.Core.DataAugmentation.Scene
return mapping.SearchTerm; return mapping.SearchTerm;
} }
public Nullable<Int32> GetTvDbId(string cleanName) public Nullable<Int32> GetTvDbId(string cleanName)
{ {
var mapping = _gettvdbIdCache.Find(cleanName.CleanSeriesTitle()); var mapping = _gettvdbIdCache.Find(cleanName.CleanSeriesTitle());
@ -55,7 +54,6 @@ namespace NzbDrone.Core.DataAugmentation.Scene
return mapping.TvdbId; return mapping.TvdbId;
} }
private void UpdateMappings() private void UpdateMappings()
{ {
_logger.Info("Updating Scene mapping"); _logger.Info("Updating Scene mapping");
@ -74,7 +72,6 @@ namespace NzbDrone.Core.DataAugmentation.Scene
} }
_repository.InsertMany(mappings); _repository.InsertMany(mappings);
} }
else else
{ {