mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-22 22:14:44 -04:00
Anime!
New: Anime support New: pull alternate names from thexem.de New: Search using all alternate names (if rage ID is unavailable) New: Show scene mapping information when hovering over episode number New: Full season searching for anime (searches for each episode) New: animezb.com anime indexer New: Treat BD as bluray Fixed: Parsing of 2 digit absolute episode numbers Fixed: Loading series details page for series that start with period Fixed: Return 0 results when manual search fails, instead of an error Fixed: animezb URL
This commit is contained in:
@@ -6,6 +6,6 @@ namespace NzbDrone.Core.MetadataSource
|
||||
{
|
||||
public interface IProvideSeriesInfo
|
||||
{
|
||||
Tuple<Series, List<Episode>> GetSeriesInfo(int tvDbSeriesId);
|
||||
Tuple<Series, List<Episode>> GetSeriesInfo(int tvdbSeriesId);
|
||||
}
|
||||
}
|
||||
@@ -80,10 +80,10 @@ namespace NzbDrone.Core.MetadataSource
|
||||
}
|
||||
}
|
||||
|
||||
public Tuple<Series, List<Episode>> GetSeriesInfo(int tvDbSeriesId)
|
||||
public Tuple<Series, List<Episode>> GetSeriesInfo(int tvdbSeriesId)
|
||||
{
|
||||
var client = BuildClient("show", "summary");
|
||||
var restRequest = new RestRequest(tvDbSeriesId.ToString() + "/extended");
|
||||
var restRequest = new RestRequest(tvdbSeriesId.ToString() + "/extended");
|
||||
var response = client.ExecuteAndValidate<Show>(restRequest);
|
||||
|
||||
var episodes = response.seasons.SelectMany(c => c.episodes).Select(MapEpisode).ToList();
|
||||
@@ -111,7 +111,7 @@ namespace NzbDrone.Core.MetadataSource
|
||||
series.Runtime = show.runtime;
|
||||
series.Network = show.network;
|
||||
series.AirTime = show.air_time;
|
||||
series.TitleSlug = show.url.ToLower().Replace("http://trakt.tv/show/", "");
|
||||
series.TitleSlug = GetTitleSlug(show.url);
|
||||
series.Status = GetSeriesStatus(show.status, show.ended);
|
||||
series.Ratings = GetRatings(show.ratings);
|
||||
series.Genres = show.genres;
|
||||
@@ -131,7 +131,6 @@ namespace NzbDrone.Core.MetadataSource
|
||||
var episode = new Episode();
|
||||
episode.Overview = traktEpisode.overview;
|
||||
episode.SeasonNumber = traktEpisode.season;
|
||||
episode.EpisodeNumber = traktEpisode.episode;
|
||||
episode.EpisodeNumber = traktEpisode.number;
|
||||
episode.Title = traktEpisode.title;
|
||||
episode.AirDate = FromIsoToString(traktEpisode.first_aired_iso);
|
||||
@@ -273,5 +272,17 @@ namespace NzbDrone.Core.MetadataSource
|
||||
|
||||
return seasons;
|
||||
}
|
||||
|
||||
private static String GetTitleSlug(String url)
|
||||
{
|
||||
var slug = url.ToLower().Replace("http://trakt.tv/show/", "");
|
||||
|
||||
if (slug.StartsWith("."))
|
||||
{
|
||||
slug = "dot" + slug.Substring(1);
|
||||
}
|
||||
|
||||
return slug;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Xml.Linq;
|
||||
using NzbDrone.Core.Indexers;
|
||||
using NzbDrone.Core.Tv;
|
||||
using RestSharp;
|
||||
|
||||
namespace NzbDrone.Core.MetadataSource.Tvdb
|
||||
{
|
||||
public interface ITvdbProxy
|
||||
{
|
||||
List<Episode> GetEpisodeInfo(int tvdbSeriesId);
|
||||
}
|
||||
|
||||
public class TvdbProxy : ITvdbProxy
|
||||
{
|
||||
public Tuple<Series, List<Episode>> GetSeriesInfo(int tvdbSeriesId)
|
||||
{
|
||||
var client = BuildClient("series");
|
||||
var request = new RestRequest(tvdbSeriesId + "/all");
|
||||
|
||||
var response = client.Execute(request);
|
||||
|
||||
var xml = XDocument.Load(new StringReader(response.Content));
|
||||
|
||||
var episodes = xml.Descendants("Episode").Select(MapEpisode).ToList();
|
||||
var series = MapSeries(xml.Element("Series"));
|
||||
|
||||
return new Tuple<Series, List<Episode>>(series, episodes);
|
||||
}
|
||||
|
||||
public List<Episode> GetEpisodeInfo(int tvdbSeriesId)
|
||||
{
|
||||
return GetSeriesInfo(tvdbSeriesId).Item2;
|
||||
}
|
||||
|
||||
private static IRestClient BuildClient(string resource)
|
||||
{
|
||||
return new RestClient(String.Format("http://thetvdb.com/data/{0}", resource));
|
||||
}
|
||||
|
||||
private static Series MapSeries(XElement item)
|
||||
{
|
||||
//TODO: We should map all the data incase we want to actually use it
|
||||
var series = new Series();
|
||||
|
||||
return series;
|
||||
}
|
||||
|
||||
private static Episode MapEpisode(XElement item)
|
||||
{
|
||||
//TODO: We should map all the data incase we want to actually use it
|
||||
var episode = new Episode();
|
||||
episode.SeasonNumber = item.TryGetValue("SeasonNumber", 0);
|
||||
episode.EpisodeNumber = item.TryGetValue("EpisodeNumber", 0);
|
||||
episode.AbsoluteEpisodeNumber = item.TryGetValue("absolute_number", 0);
|
||||
|
||||
return episode;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user