From 08ec4e7d45ef0d605be617a5042cd9cd2a323097 Mon Sep 17 00:00:00 2001 From: Ben Roberts Date: Mon, 9 Jan 2012 20:14:14 +0000 Subject: [PATCH] Fix incorrect removal of trailing zeroes from season/episode numbers --- source/lib/DownloadDispatcher/Source/Plugin/TV.class.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/source/lib/DownloadDispatcher/Source/Plugin/TV.class.php b/source/lib/DownloadDispatcher/Source/Plugin/TV.class.php index d77612d..e8ed044 100644 --- a/source/lib/DownloadDispatcher/Source/Plugin/TV.class.php +++ b/source/lib/DownloadDispatcher/Source/Plugin/TV.class.php @@ -91,7 +91,7 @@ class DownloadDispatcher_Source_Plugin_TV extends DownloadDispatcher_Source_Plug } } - DownloadDispatcher_LogEntry::warning($this->log, "TV output directory for '{$file}' could not be identified; you may need to create one."); + DownloadDispatcher_LogEntry::warning($this->log, "TV output directory for '{$file}' ({$normalised_file}) could not be identified; you may need to create one."); return null; } @@ -106,7 +106,6 @@ class DownloadDispatcher_Source_Plugin_TV extends DownloadDispatcher_Source_Plug $normalised_series = $this->normalise($series_name); $this->output_dir_cache[$normalised_series] = $series_name; } - } protected function normalise($name) { @@ -126,7 +125,7 @@ class DownloadDispatcher_Source_Plugin_TV extends DownloadDispatcher_Source_Plug $set_season = function($a) { for ($i = 1, $l = count($a); $i < $l; ++$i) { if ($a[$i]) { - return trim($a[$i], '0'); + return ltrim($a[$i], '0'); } } return null; @@ -143,7 +142,7 @@ class DownloadDispatcher_Source_Plugin_TV extends DownloadDispatcher_Source_Plug $set_episode = function($a) { for ($i = 1, $l = count($a); $i < $l; ++$i) { if ($a[$i]) { - return trim($a[$i], '0'); + return ltrim($a[$i], '0'); } } return null; @@ -238,4 +237,4 @@ EOSH; } -?> \ No newline at end of file +?>