toname 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/to_name.rb +3 -3
- metadata +2 -2
data/lib/to_name.rb
CHANGED
@@ -5,7 +5,7 @@ class ToName
|
|
5
5
|
FILE_SEP_REGEX = /\//
|
6
6
|
FILE_EXT_SEP_REGEX = /\./
|
7
7
|
CD_FOLDER_REGEX = /\/CD(\d)\//
|
8
|
-
#Chars used in
|
8
|
+
#Chars used in filenames as a substitute for spaces
|
9
9
|
SPACE_SUB_REGEX = /(\.|_|\-)/
|
10
10
|
VIDEO_TYPE_NAMES = ['DVDRIP', '1080p', '720p','R5', 'DVDSCR', 'BDRip', 'CAM', 'TS', 'PPV', 'Xvid', 'divx', 'DVDSCREENER']
|
11
11
|
CONTENT_SOURCE_FOLDER_TEST_REGEX = /#{VIDEO_TYPE_NAMES.join('|')}/i
|
@@ -42,12 +42,12 @@ class ToName
|
|
42
42
|
#Extract year if it's in the filename
|
43
43
|
if name =~ YEAR_REGEX && name.index(YEAR_REGEX) > 0
|
44
44
|
name = $`
|
45
|
-
#Strip any
|
45
|
+
#Strip any surrounding brackets and convert to int
|
46
46
|
year = $&.gsub(/\(|\)|\[|\]/, '').to_i
|
47
47
|
end
|
48
48
|
|
49
49
|
#Strip LIMITED off the end. Note: This is NOT case sensitive
|
50
|
-
name = $` if name =~ /LIMITED$/
|
50
|
+
name = $` if name =~ /LIMITED|LiMiTED$/
|
51
51
|
|
52
52
|
#Try to extract the session and episode
|
53
53
|
session = nil
|