mirror of
https://github.com/Sonarr/Sonarr.git
synced 2024-12-16 11:37:58 +02:00
parent
7b7f48a0e3
commit
2b8ab92ef7
@ -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 @@ public void should_parse_full_season_release(string postTitle, string title, int
|
|||||||
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")]
|
||||||
|
@ -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 @@ private ImportDecision GetDecision(string file, Series series, DownloadClientIte
|
|||||||
{
|
{
|
||||||
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"));
|
||||||
|
@ -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 @@ public class ParsedEpisodeInfo
|
|||||||
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; }
|
||||||
|
@ -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 @@ private static ParsedEpisodeInfo ParseMatchCollection(MatchCollection matchColle
|
|||||||
|
|
||||||
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
|
||||||
|
Loading…
Reference in New Issue
Block a user