1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-10-30 15:32:31 +01:00

Fixed: Parse and reject season extras

Fixes #2176
This commit is contained in:
Mark McDowall 2017-09-21 18:28:44 -07:00
parent 7b7f48a0e3
commit 2b8ab92ef7
No known key found for this signature in database
GPG Key ID: D4CEFA9A718052E0
4 changed files with 27 additions and 13 deletions

View File

@ -1,4 +1,4 @@
using FluentAssertions; using FluentAssertions;
using NUnit.Framework; using NUnit.Framework;
using NzbDrone.Core.Test.Framework; using NzbDrone.Core.Test.Framework;
@ -34,14 +34,20 @@ namespace NzbDrone.Core.Test.ParserTests
result.FullSeason.Should().BeTrue(); result.FullSeason.Should().BeTrue();
} }
[TestCase("Acropolis Now S05 EXTRAS DVDRip XviD RUNNER")] [TestCase("Acropolis Now S05 EXTRAS DVDRip XviD RUNNER", "Acropolis Now", 5)]
[TestCase("Punky Brewster S01 EXTRAS DVDRip XviD RUNNER")] [TestCase("Punky Brewster S01 EXTRAS DVDRip XviD RUNNER", "Punky Brewster", 1)]
[TestCase("Instant Star S03 EXTRAS DVDRip XviD OSiTV")] [TestCase("Instant Star S03 EXTRAS DVDRip XviD OSiTV", "Instant Star", 3)]
public void should_parse_season_extras(string postTitle) [TestCase("The.Flash.S03.Extras.01.Deleted.Scenes.720p", "The Flash", 3)]
[TestCase("The.Flash.S03.Extras.02.720p", "The Flash", 3)]
public void should_parse_season_extras(string postTitle, string title, int season)
{ {
var result = Parser.Parser.ParseTitle(postTitle); var result = Parser.Parser.ParseTitle(postTitle);
result.SeasonNumber.Should().Be(season);
result.Should().BeNull(); result.SeriesTitle.Should().Be(title);
result.EpisodeNumbers.Should().BeEmpty();
result.AbsoluteEpisodeNumbers.Should().BeEmpty();
result.FullSeason.Should().BeTrue();
result.IsSeasonExtra.Should().BeTrue();
} }
[TestCase("Lie.to.Me.S03.SUBPACK.DVDRip.XviD-REWARD")] [TestCase("Lie.to.Me.S03.SUBPACK.DVDRip.XviD-REWARD")]

View File

@ -1,4 +1,4 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
@ -98,6 +98,10 @@ namespace NzbDrone.Core.MediaFiles.EpisodeImport
{ {
decision = new ImportDecision(localEpisode, new Rejection("Partial season packs are not supported")); decision = new ImportDecision(localEpisode, new Rejection("Partial season packs are not supported"));
} }
else if (localEpisode.ParsedEpisodeInfo.IsSeasonExtra)
{
decision = new ImportDecision(localEpisode, new Rejection("Extras are not supported"));
}
else else
{ {
decision = new ImportDecision(localEpisode, new Rejection("Invalid season or episode")); decision = new ImportDecision(localEpisode, new Rejection("Invalid season or episode"));

View File

@ -1,4 +1,4 @@
using System.Linq; using System.Linq;
using NzbDrone.Common.Extensions; using NzbDrone.Common.Extensions;
using NzbDrone.Core.Qualities; using NzbDrone.Core.Qualities;
@ -17,6 +17,7 @@ namespace NzbDrone.Core.Parser.Model
public Language Language { get; set; } public Language Language { get; set; }
public bool FullSeason { get; set; } public bool FullSeason { get; set; }
public bool IsPartialSeason { get; set; } public bool IsPartialSeason { get; set; }
public bool IsSeasonExtra { get; set; }
public bool Special { get; set; } public bool Special { get; set; }
public string ReleaseGroup { get; set; } public string ReleaseGroup { get; set; }
public string ReleaseHash { get; set; } public string ReleaseHash { get; set; }

View File

@ -1,4 +1,4 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
@ -602,9 +602,12 @@ namespace NzbDrone.Core.Parser
if (!episodeCaptures.Any() && !absoluteEpisodeCaptures.Any()) if (!episodeCaptures.Any() && !absoluteEpisodeCaptures.Any())
{ {
//Check to see if this is an "Extras" or "SUBPACK" release, if it is, return NULL //Check to see if this is an "Extras" or "SUBPACK" release, if it is, set
//Todo: Set a "Extras" flag in EpisodeParseResult if we want to download them ever // IsSeasonExtra so they can be filtered out
if (!matchCollection[0].Groups["extras"].Value.IsNullOrWhiteSpace()) return null; if (!matchCollection[0].Groups["extras"].Value.IsNullOrWhiteSpace())
{
result.IsSeasonExtra = true;
}
// Partial season packs will have a seasonpart group so they can be differentiated // Partial season packs will have a seasonpart group so they can be differentiated
// from a full season/single episode release // from a full season/single episode release