3 Commits

Author SHA1 Message Date
Godzil
56afce02ea 1.1.10
- Change name format to follow Plex forvourite one.
- Remplace ":" in file name to prevent issue on Windows
2016-09-10 20:22:10 +01:00
Godzil
bc4697061e Remplace ':' in filename to make Windows happy 2016-09-10 20:17:19 +01:00
Godzil
55ffe85f77 Make the name to be more Plex friendly 2016-09-10 11:53:45 +01:00
2 changed files with 5 additions and 5 deletions

View File

@@ -12,7 +12,7 @@
"type": "git", "type": "git",
"url": "git://github.com/Godzil/crunchyroll.js.git" "url": "git://github.com/Godzil/crunchyroll.js.git"
}, },
"version": "1.1.9", "version": "1.1.10",
"bin": { "bin": {
"crunchy": "./bin/crunchy" "crunchy": "./bin/crunchy"
}, },

View File

@@ -51,8 +51,8 @@ function fileExist(path: string) {
*/ */
function download(config: IConfig, page: IEpisodePage, player: IEpisodePlayer, done: (err: Error, ign: boolean) => void) { function download(config: IConfig, page: IEpisodePage, player: IEpisodePlayer, done: (err: Error, ign: boolean) => void) {
var series = config.series || page.series; var series = config.series || page.series;
series = series.replace("/","_").replace("'","_"); series = series.replace("/","_").replace("'","_").replace(":","_");
var fileName = name(config, page, series, "").replace("/","_").replace("'","_"); var fileName = name(config, page, series, "").replace("/","_").replace("'","_").replace(":","_");
var filePath = path.join(config.output || process.cwd(), series, fileName); var filePath = path.join(config.output || process.cwd(), series, fileName);
if (fileExist(filePath + ".mkv")) if (fileExist(filePath + ".mkv"))
{ {
@@ -61,7 +61,7 @@ function download(config: IConfig, page: IEpisodePage, player: IEpisodePlayer, d
do do
{ {
count = count + 1; count = count + 1;
fileName = name(config, page, series, "-" + count).replace("/","_").replace("'","_"); fileName = name(config, page, series, "-" + count).replace("/","_").replace("'","_").replace(":","_");
filePath = path.join(config.output || process.cwd(), series, fileName); filePath = path.join(config.output || process.cwd(), series, fileName);
} while(fileExist(filePath + ".mkv")) } while(fileExist(filePath + ".mkv"))
console.info("Renaming to '"+fileName+"'..."); console.info("Renaming to '"+fileName+"'...");
@@ -137,7 +137,7 @@ function name(config: IConfig, page: IEpisodePage, series: string, extra: string
var episode = (episodeNum < 10 ? '0' : '') + page.episode; var episode = (episodeNum < 10 ? '0' : '') + page.episode;
var volume = (volumeNum < 10 ? '0' : '') + page.volume; var volume = (volumeNum < 10 ? '0' : '') + page.volume;
var tag = config.tag || 'CrunchyRoll'; var tag = config.tag || 'CrunchyRoll';
return series + ' ' + volume + 'x' + episode + extra + ' [' + tag + ']'; return series + ' - s' + volume + 'e' + episode +' - [' + tag + ']' + extra;
} }
/** /**