|
|
|
@ -2,7 +2,6 @@
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.IO;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Runtime.Remoting.Messaging;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Text.RegularExpressions;
|
|
|
|
|
using System.Xml;
|
|
|
|
@ -10,11 +9,8 @@ using System.Xml.Linq;
|
|
|
|
|
using NLog;
|
|
|
|
|
using NzbDrone.Common;
|
|
|
|
|
using NzbDrone.Common.Disk;
|
|
|
|
|
using NzbDrone.Common.Http;
|
|
|
|
|
using NzbDrone.Core.Datastore;
|
|
|
|
|
using NzbDrone.Core.MediaCover;
|
|
|
|
|
using NzbDrone.Core.MediaFiles;
|
|
|
|
|
using NzbDrone.Core.Messaging.Events;
|
|
|
|
|
using NzbDrone.Core.Metadata.Files;
|
|
|
|
|
using NzbDrone.Core.Tv;
|
|
|
|
|
|
|
|
|
@ -36,7 +32,7 @@ namespace NzbDrone.Core.Metadata.Consumers.Roksbox
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private static List<string> ValidCertification = new List<string> { "G", "NC-17", "PG", "PG-13", "R", "UR", "UNRATED", "NR", "TV-Y", "TV-Y7", "TV-Y7-FV", "TV-G", "TV-PG", "TV-14", "TV-MA" };
|
|
|
|
|
private static readonly Regex SeasonImagesRegex = new Regex(@"^(season (?<season>\d+))|(?<season>specials)", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
|
|
|
|
private static readonly Regex SeasonImagesRegex = new Regex(@"^(season (?<season>\d+))|(?<specials>specials)", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
|
|
|
|
|
|
|
|
|
public override List<MetadataFile> AfterRename(Series series, List<MetadataFile> existingMetadataFiles, List<EpisodeFile> episodeFiles)
|
|
|
|
|
{
|
|
|
|
@ -97,26 +93,27 @@ namespace NzbDrone.Core.Metadata.Consumers.Roksbox
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//Series and season images are both named folder.jpg, only season ones sit in season folders
|
|
|
|
|
if (String.Compare(filename, parentdir.Name, StringComparison.InvariantCultureIgnoreCase) == 0)
|
|
|
|
|
if (Path.GetFileNameWithoutExtension(filename).Equals(parentdir.Name, StringComparison.InvariantCultureIgnoreCase))
|
|
|
|
|
{
|
|
|
|
|
var seasonMatch = SeasonImagesRegex.Match(parentdir.Name);
|
|
|
|
|
|
|
|
|
|
if (seasonMatch.Success)
|
|
|
|
|
{
|
|
|
|
|
metadata.Type = MetadataType.SeasonImage;
|
|
|
|
|
|
|
|
|
|
var seasonNumber = seasonMatch.Groups["season"].Value;
|
|
|
|
|
|
|
|
|
|
if (seasonNumber.Contains("specials"))
|
|
|
|
|
if (seasonMatch.Groups["specials"].Success)
|
|
|
|
|
{
|
|
|
|
|
metadata.SeasonNumber = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
metadata.SeasonNumber = Convert.ToInt32(seasonNumber);
|
|
|
|
|
metadata.SeasonNumber = Convert.ToInt32(seasonMatch.Groups["season"].Value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return metadata;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
metadata.Type = MetadataType.SeriesImage;
|
|
|
|
|