dbr / tvnamer

Automatic TV episode file renamer, uses data from thetvdb.com via tvdb_api
https://pypi.python.org/pypi/tvnamer/
The Unlicense
912 stars 115 forks source link

Aways copying instead move or rename #78

Open ducapedia opened 11 years ago

ducapedia commented 11 years ago

Even withou move options, tvnamer still creating a copy of file then renaming it. I already try many options in config file like "aways_copy": false and "copy_instead_move": false... but even withou any config file (just "tvnamer file.mp4"), its copying the file. Thats output:

tvnamer -c /etc/tvnamer.conf Family.Guy.S11E16.HDTV.x264-L
OL.*
Loading config: /etc/tvnamer.conf
####################
# Starting tvnamer
# Found 2 episodes
####################
# Processing file: Family.Guy.S11E16.HDTV.x264-LOL.srt
# Detected series: Family Guy (season: 11, episode: 16)
####################
Old filename: Family.Guy.S11E16.HDTV.x264-LOL.srt
New filename: Family Guy - [11x16] - 12 and a Half Angry Men.srt
New path: /mnt/Downloads/Family Guy - [11x16] - 12 and a Half Angry Men.srt
Creating directory /mnt/Downloads
copy /mnt/Downloads/Family.Guy.S11E16.HDTV.x264-LOL.srt to /mnt/Downloads/Family Guy - [11x16] - 12 and a Half Angry Men.srt
New path: /mnt/Uploads/Series/Family Guy/Family Guy - [11x16] - 12 and a Half Angry Men.srt
Creating directory /mnt/Uploads/Series/Family Guy
copy /mnt/Downloads/Family Guy - [11x16] - 12 and a Half Angry Men.srt to /mnt/Uploads/Series/Family Guy/Family Guy - [11x16] - 12 and a Half Angry Men.srt
Deleting /mnt/Downloads/Family Guy - [11x16] - 12 and a Half Angry Men.srt

####################
# Processing file: Family.Guy.S11E16.HDTV.x264-LOL.mp4
# Detected series: Family Guy (season: 11, episode: 16)
####################
Old filename: Family.Guy.S11E16.HDTV.x264-LOL.mp4
New filename: Family Guy - [11x16] - 12 and a Half Angry Men.mp4
New path: /mnt/Downloads/Family Guy - [11x16] - 12 and a Half Angry Men.mp4
Creating directory /mnt/Downloads
copy /mnt/Downloads/Family.Guy.S11E16.HDTV.x264-LOL.mp4 to /mnt/Downloads/Family Guy - [11x16] - 12 and a Half Angry Men.mp4
New path: /mnt/Uploads/Series/Family Guy/Family Guy - [11x16] - 12 and a Half Angry Men.mp4
Creating directory /mnt/Uploads/Series/Family Guy
copy /mnt/Downloads/Family Guy - [11x16] - 12 and a Half Angry Men.mp4 to /mnt/Uploads/Series/Family Guy/Family Guy - [11x16] - 12 and a Half Angry Men.mp4
Deleting /mnt/Downloads/Family Guy - [11x16] - 12 and a Half Angry Men.mp4

####################
# Done
ducapedia commented 11 years ago

I correct myself.. In that last try.. tvnamer copy the files.. rename it and copy new files renamed to another direcory and then delete file renamed in original directory.. and let original file behind. Thers two copy... instead only rename the file and move it renamed. And these folders are in same hdd and same partition.. not in a network filesystem.

that try above have a config file like:

{ "language": "en", "search_all_languages": false, "batch": true, "select_first": true, "always_rename": true, "always_move": true, "always_copy": false, "copy_instead_of_move": false, "move_files_enable": true, "verbose": true, "recursive": true, "skip_file_on_error": true, "valid_extensions": ["avi", "mkv", "mp4", "srt", "sub"], "move_files_destination": "/mnt/Uploads/Series/%(seriesname)s" }

and when the file is big.. take many time to finish (because copying instead rename and moving) Like I said before if I just use withou tvnamer.conf, tvnamer copy file then rename the copy, leting original file in same directory.

lahwaacz commented 11 years ago

I think I corrected this in this pull request, but it's not (yet) accepted. Anyway, I hope it helps. Any feedback would be appreciated.

ducapedia commented 11 years ago

Hum.. But thats strange. I used tvnamer at least 3 years from now... but only now I have updated it. That issue this never happens before... in the old version I was running in my dd-wrt (I cant renember what version was), tvnamer only rename (when I run it with "tvnamer -b serie.mp4") and rename and move with this same config file. Just now (I have changed from dd-wrt to openwrt this week), I download tvnamer current version, and I was surprised with this annoing issue. What was changed ? Theres some way to download the old version when all works fine to me at least ?

ducapedia commented 11 years ago

Hum.. I found old versions at here: http://pypi.python.org/packages/source/t/tvnamer/ If anyone had the same problem, I thing 2.0 was ok, but I'm not sure yet.. I'll begin the tests by now.

dbr commented 11 years ago

I'm confused what the problem is.

As I understand it: the file is copied once when it is renamed, and once again when the file is moved.. even though the file is on the same partition, so should just be renamed?

If so, does the problem happen if you run with no config?

dbr commented 11 years ago

Also, you can check out various versions of tvnamer by cloning the git repository,

$ cd tvnamer
$ git tag -l
2.0
2.1
2.2
2.2.1
$ git checkout 2.1

(you could even use git bisect to narrow down which specific commit caused the problem, like this)

ducapedia commented 11 years ago

Yes... Thats the problem. When I run, the original file stays (in same directory), they create a new one with the new name (create a copy, thats take so long in a router like ASUS RTN13U using OpenWRT or DD-WRT), and then, copy (again) to another directory.. and so delete the copy with new name in original file (and the original downloaded without rename persist). Is two coping process.. I renember the old version (before I reinstall my router) the processe was most like in no time. (just rename, and move instead copy).

When I run without any config, they ask what is the series name (with options numbers), and when I choose one, they show mostly the same message:

Creating directory /mnt/Downloads copy /mnt/Downloads/Family.Guy.S11E16.HDTV.x264-LOL.mp4 to /mnt/Downloads/Family Guy - [11x16] - 12 and a Half Angry Men.mp4 ..etc..

And no delete. I change to 2.0 and when I run without config, they only rename the original file (without create any copy). But... I'm getting the same error when I using the move option (they create a copy and then delete instead only use "mv")