From 72d8d3d0c3f1e76a62779fca0bbbfebaa7d117e7 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sat, 13 Nov 2010 21:00:28 -0500 Subject: [PATCH] Moving now works after performing a TVRename. --- web_frontend/tv_renamer.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/web_frontend/tv_renamer.js b/web_frontend/tv_renamer.js index 322021d..8059f8a 100644 --- a/web_frontend/tv_renamer.js +++ b/web_frontend/tv_renamer.js @@ -67,7 +67,7 @@ armadillo.TVRenamer.prototype.lookupHandler_ = function(e) { if (tags['Show Name'] && tags['Episode Info']) { var episode = tags['Episode Info'].split('^'); var name = tags['Show Name'] + ' - ' + episode[0] + ' - ' + episode[1]; - console.log('final name = ' + name); + this.rename_(name); } }; @@ -98,3 +98,13 @@ armadillo.TVRenamer.prototype.buildURL_ = function(show, season, episode) { return "http://services.tvrage.com/tools/quickinfo.php?show=" + show + "&ep=" + season + "x" + episode; }; + +/** + * Performs the actual rename of the current file to the |newName|. + * @param {string!} newName + * @private + */ +armadillo.TVRenamer.prototype.rename_ = function(newName) { + var path = app.joinPath(this.file_.getParentPath(), newName); + this.file_.move(path); +}; -- 2.43.5