parent
01c1943d0e
commit
a49850cc89
@ -1,115 +1,120 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
<queue><active_lang>us-en</active_lang>
|
<queue>
|
||||||
<session>5c770e3197e4fe763423ee7c392c25d1</session>
|
<active_lang>us-en</active_lang>
|
||||||
<slots><slot><status>Queued</status>
|
<session>5c770e3197e4fe763423ee7c392c25d1</session>
|
||||||
<index>0</index>
|
<slots>
|
||||||
<eta>unknown</eta>
|
<slot>
|
||||||
<timeleft>0:00:00</timeleft>
|
<status>Queued</status>
|
||||||
<avg_age>11h</avg_age>
|
<index>0</index>
|
||||||
<script>None</script>
|
<eta>unknown</eta>
|
||||||
|
<timeleft>0:00:00</timeleft>
|
||||||
|
<avg_age>11h</avg_age>
|
||||||
|
<script>None</script>
|
||||||
|
|
||||||
<msgid></msgid>
|
<msgid></msgid>
|
||||||
<verbosity></verbosity>
|
<verbosity></verbosity>
|
||||||
<mb>770.96</mb>
|
<mb>770.96</mb>
|
||||||
<sizeleft>770.96 MB</sizeleft>
|
<sizeleft>770.96 MB</sizeleft>
|
||||||
<filename>Ubuntu Test</filename>
|
<filename>Ubuntu Test</filename>
|
||||||
<priority>Normal</priority>
|
<priority>Normal</priority>
|
||||||
<cat>None</cat>
|
<cat>None</cat>
|
||||||
<mbleft>770.96</mbleft>
|
<mbleft>770.96</mbleft>
|
||||||
<percentage>0</percentage>
|
<percentage>0</percentage>
|
||||||
<nzo_id>SABnzbd_nzo_xyr5ak</nzo_id>
|
<nzo_id>SABnzbd_nzo_xyr5ak</nzo_id>
|
||||||
|
|
||||||
<unpackopts>3</unpackopts>
|
<unpackopts>3</unpackopts>
|
||||||
<size>770.96 MB</size>
|
<size>770.96 MB</size>
|
||||||
</slot>
|
</slot>
|
||||||
</slots>
|
</slots>
|
||||||
<speed>0 </speed>
|
<speed>0 </speed>
|
||||||
<size>770.96 MB</size>
|
<size>770.96 MB</size>
|
||||||
<limit>0</limit>
|
<limit>0</limit>
|
||||||
<start>0</start>
|
<start>0</start>
|
||||||
<diskspacetotal2>259.45</diskspacetotal2>
|
<diskspacetotal2>259.45</diskspacetotal2>
|
||||||
<darwin>False</darwin>
|
<darwin>False</darwin>
|
||||||
|
|
||||||
<last_warning></last_warning>
|
<last_warning></last_warning>
|
||||||
<have_warnings>0</have_warnings>
|
<have_warnings>0</have_warnings>
|
||||||
<noofslots>1</noofslots>
|
<noofslots>1</noofslots>
|
||||||
<pause_int>0</pause_int>
|
<pause_int>0</pause_int>
|
||||||
<categories><category>None</category>
|
<categories>
|
||||||
<category>anime</category>
|
<category>None</category>
|
||||||
<category>apps</category>
|
<category>anime</category>
|
||||||
<category>books</category>
|
<category>apps</category>
|
||||||
<category>consoles</category>
|
<category>books</category>
|
||||||
|
<category>consoles</category>
|
||||||
|
|
||||||
<category>ds-games</category>
|
<category>ds-games</category>
|
||||||
<category>emulation</category>
|
<category>emulation</category>
|
||||||
<category>games</category>
|
<category>games</category>
|
||||||
<category>misc</category>
|
<category>misc</category>
|
||||||
<category>movies</category>
|
<category>movies</category>
|
||||||
<category>music</category>
|
<category>music</category>
|
||||||
<category>pda</category>
|
<category>pda</category>
|
||||||
<category>resources</category>
|
<category>resources</category>
|
||||||
<category>test</category>
|
<category>test</category>
|
||||||
|
|
||||||
<category>tv</category>
|
<category>tv</category>
|
||||||
<category>tv-dvd</category>
|
<category>tv-dvd</category>
|
||||||
<category>unknown</category>
|
<category>unknown</category>
|
||||||
<category>wii-games</category>
|
<category>wii-games</category>
|
||||||
<category>xbox-dlc</category>
|
<category>xbox-dlc</category>
|
||||||
<category>xbox-xbla</category>
|
<category>xbox-xbla</category>
|
||||||
</categories>
|
</categories>
|
||||||
<diskspacetotal1>259.45</diskspacetotal1>
|
<diskspacetotal1>259.45</diskspacetotal1>
|
||||||
<mb>770.96</mb>
|
<mb>770.96</mb>
|
||||||
|
|
||||||
<loadavg></loadavg>
|
<loadavg></loadavg>
|
||||||
<cache_max>157286400</cache_max>
|
<cache_max>157286400</cache_max>
|
||||||
<speedlimit></speedlimit>
|
<speedlimit></speedlimit>
|
||||||
<webdir>C:\Program Files\SABnzbd\interfaces\Plush\templates</webdir>
|
<webdir>C:\Program Files\SABnzbd\interfaces\Plush\templates</webdir>
|
||||||
<paused>True</paused>
|
<paused>True</paused>
|
||||||
<isverbose>False</isverbose>
|
<isverbose>False</isverbose>
|
||||||
<restart_req>False</restart_req>
|
<restart_req>False</restart_req>
|
||||||
<power_options>True</power_options>
|
<power_options>True</power_options>
|
||||||
<helpuri>http://wiki.sabnzbd.org/</helpuri>
|
<helpuri>http://wiki.sabnzbd.org/</helpuri>
|
||||||
<uptime>4d</uptime>
|
<uptime>4d</uptime>
|
||||||
|
|
||||||
<refresh_rate></refresh_rate>
|
<refresh_rate></refresh_rate>
|
||||||
<version>0.6.x</version>
|
<version>0.6.x</version>
|
||||||
<color_scheme></color_scheme>
|
<color_scheme></color_scheme>
|
||||||
<new_release></new_release>
|
<new_release></new_release>
|
||||||
<nt>True</nt>
|
<nt>True</nt>
|
||||||
<status>Paused</status>
|
<status>Paused</status>
|
||||||
<finish>0</finish>
|
<finish>0</finish>
|
||||||
<cache_art>0</cache_art>
|
<cache_art>0</cache_art>
|
||||||
<paused_all>False</paused_all>
|
<paused_all>False</paused_all>
|
||||||
<finishaction></finishaction>
|
<finishaction></finishaction>
|
||||||
<sizeleft>770.96 MB</sizeleft>
|
<sizeleft>770.96 MB</sizeleft>
|
||||||
|
|
||||||
<cache_size>0B</cache_size>
|
<cache_size>0B</cache_size>
|
||||||
<mbleft>770.96</mbleft>
|
<mbleft>770.96</mbleft>
|
||||||
<diskspace2>1177.64</diskspace2>
|
<diskspace2>1177.64</diskspace2>
|
||||||
<diskspace1>1177.64</diskspace1>
|
<diskspace1>1177.64</diskspace1>
|
||||||
<scripts><script>None</script>
|
<scripts>
|
||||||
<script>Alias.config</script>
|
<script>None</script>
|
||||||
<script>ConsoleCategories.config</script>
|
<script>Alias.config</script>
|
||||||
<script>exiso.exe</script>
|
<script>ConsoleCategories.config</script>
|
||||||
<script>Movies.exe</script>
|
<script>exiso.exe</script>
|
||||||
|
<script>Movies.exe</script>
|
||||||
|
|
||||||
<script>Movies.exe.config</script>
|
<script>Movies.exe.config</script>
|
||||||
<script>Movies.pdb</script>
|
<script>Movies.pdb</script>
|
||||||
<script>PreQueue.exe</script>
|
<script>PreQueue.exe</script>
|
||||||
<script>PreQueue.exe.config</script>
|
<script>PreQueue.exe.config</script>
|
||||||
<script>PreQueue.pdb</script>
|
<script>PreQueue.pdb</script>
|
||||||
<script>SABTest.exe</script>
|
<script>SABTest.exe</script>
|
||||||
<script>TVMove.exe</script>
|
<script>TVMove.exe</script>
|
||||||
<script>TVMove.exe.config</script>
|
<script>TVMove.exe.config</script>
|
||||||
<script>TVMove_0.4.1.exe</script>
|
<script>TVMove_0.4.1.exe</script>
|
||||||
|
|
||||||
<script>XBox360.exe</script>
|
<script>XBox360.exe</script>
|
||||||
<script>XBox360.exe.config</script>
|
<script>XBox360.exe.config</script>
|
||||||
</scripts>
|
</scripts>
|
||||||
<timeleft>0:00:00</timeleft>
|
<timeleft>0:00:00</timeleft>
|
||||||
<nzb_quota></nzb_quota>
|
<nzb_quota></nzb_quota>
|
||||||
<eta>unknown</eta>
|
<eta>unknown</eta>
|
||||||
<kbpersec>0.00</kbpersec>
|
<kbpersec>0.00</kbpersec>
|
||||||
<new_rel_url></new_rel_url>
|
<new_rel_url></new_rel_url>
|
||||||
<queue_details>0</queue_details>
|
<queue_details>0</queue_details>
|
||||||
</queue>
|
</queue>
|
@ -0,0 +1,68 @@
|
|||||||
|
using System;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
using NzbDrone.Core.Repository;
|
||||||
|
|
||||||
|
namespace NzbDrone.Core.Providers
|
||||||
|
{
|
||||||
|
public class EpisodeProvider
|
||||||
|
{
|
||||||
|
private static Regex _parseRegex =
|
||||||
|
new Regex(
|
||||||
|
@"(?<showName>.*)
|
||||||
|
(?:
|
||||||
|
s(?<seasonNumber>\d+)e(?<episodeNumber>\d+)-?e(?<episodeNumber2>\d+)
|
||||||
|
| s(?<seasonNumber>\d+)e(?<episodeNumber>\d+)
|
||||||
|
| (?<seasonNumber>\d+)x(?<episodeNumber>\d+)
|
||||||
|
| (?<airDate>\d{4}.\d{2}.\d{2})
|
||||||
|
)
|
||||||
|
(?:
|
||||||
|
(?<episodeName>.*?)
|
||||||
|
(?<release>
|
||||||
|
(?:hdtv|pdtv|xvid|ws|720p|x264|bdrip|dvdrip|dsr|proper)
|
||||||
|
.*)
|
||||||
|
| (?<episodeName>.*)
|
||||||
|
)", RegexOptions.IgnoreCase | RegexOptions.Compiled | RegexOptions.IgnorePatternWhitespace);
|
||||||
|
|
||||||
|
|
||||||
|
public static Episode Parse(string title)
|
||||||
|
{
|
||||||
|
Match match = _parseRegex.Match(title);
|
||||||
|
|
||||||
|
if (!match.Success)
|
||||||
|
return null;
|
||||||
|
|
||||||
|
return new Episode
|
||||||
|
{
|
||||||
|
|
||||||
|
Season = ParseInt(match.Groups["seasonNumber"].Value),
|
||||||
|
EpisodeNumber = ParseInt(match.Groups["episodeNumber"].Value),
|
||||||
|
EpisodeNumber2 = ParseInt(match.Groups["episodeNumber2"].Value),
|
||||||
|
Title = ReplaceSeparatorChars(match.Groups["episodeName"].Value),
|
||||||
|
Release = ReplaceSeparatorChars(match.Groups["release"].Value),
|
||||||
|
Proper = title.Contains("PROPER")
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
private static string ReplaceSeparatorChars(string s)
|
||||||
|
{
|
||||||
|
if (s == null) return string.Empty;
|
||||||
|
return s.Replace('.', ' ').Replace('-', ' ').Replace('_', ' ').Trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
private static int ParseInt(string s)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
int.TryParse(s, out i);
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static DateTime ParseAirDate(string s)
|
||||||
|
{
|
||||||
|
DateTime d;
|
||||||
|
if (DateTime.TryParse(ReplaceSeparatorChars(s).Replace(' ', '-'), out d))
|
||||||
|
return d;
|
||||||
|
return DateTime.MinValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,35 @@
|
|||||||
|
namespace NzbDrone.Core.Repository
|
||||||
|
{
|
||||||
|
// ReSharper disable InconsistentNaming
|
||||||
|
/// <summary>
|
||||||
|
/// Represents Video Quality
|
||||||
|
/// </summary>
|
||||||
|
public enum Quality
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Quality is unknown
|
||||||
|
/// </summary>
|
||||||
|
Unknown = 0,
|
||||||
|
/// <summary>
|
||||||
|
/// SD File (Source could be HD)
|
||||||
|
/// </summary>
|
||||||
|
SDTV = 1,
|
||||||
|
/// <summary>
|
||||||
|
/// SD File (DVD Source)
|
||||||
|
/// </summary>
|
||||||
|
DVD = 2,
|
||||||
|
/// <summary>
|
||||||
|
/// HD File (HDTV Source)
|
||||||
|
/// </summary>
|
||||||
|
HDTV = 3,
|
||||||
|
/// <summary>
|
||||||
|
/// HD File (Online Source)
|
||||||
|
/// </summary>
|
||||||
|
WEBDL = 4,
|
||||||
|
/// <summary>
|
||||||
|
/// HD File (Blu-ray Source)
|
||||||
|
/// </summary>
|
||||||
|
Bluray = 5
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in new issue