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

tvnamer for Movies? #71

Closed bignellrp closed 11 years ago

bignellrp commented 11 years ago

Hi. Tvnamer is working great for tvshows. I'm wondering if this can move my movie files into a movie folder is it doesn't recognize it as a tvshow?

nikdoof commented 11 years ago

You could do a simple wrapper script that runs tvnamer and checks the result, then if it failed move it to the directory you need. Something like:

#!/usr/bin/bash

# Your movies location
movies="/srv/movies/"

# The file you want to process
file="$1"

tvnamer "${file}"
if [ $? -gt 0 ]; then
    mv "${file}" "${movies}"
fi

[Edit]

After looking through the other issues, this probably wont work at the moment due to #73.

dbr commented 11 years ago

Until the exitcode thing is fixed up, you could use the --move feature to do this.

That way any successfully renamed series could be moved into a folder (even a temporary one), any remaining files cannot be renamed

Something vaguely along these lines:

# Make temporary folder
mkdir -p tvshows/

# Rename and move TV shows into temporary folder
tvnamer --batch *.avi --move --movedestination='tvshows/'

# Move missed video files into movies directory
mv *.avi /srv/movies

# Move tvshows back, and carefully remove empty temp dir
mv tvshows/* .
rmdir tvshows
lahwaacz commented 11 years ago

I think the original question is ambiguous (I understood it differently than nikdoof and consequently dbr), so I'll extend it.

1. Can tvnamer be used for renaming movies (e.g. search the database and rename using some pattern)?

Simply can't, because there are no movies in thetvdb.com database. There's api similar to tvdb_api in dbr's repository to search themoviedb.org database, but it isn't connected to frontend such as tvnamer (patches are welcome).

2. Can tvnamer be used to filter out non-tvshow files and move them somewhere else?

dbr answered to this, but it's not the goal of tvnamer - there are a lot of video files and to write competent filter to handle all of the possibilities would be very difficult. tvnamer just handles tv shows. The simplest solution is to move tv shows to their given location and leave other files in place.

dbr commented 11 years ago

Closing - @lahwaacz answered this nicely, specifically "tvnamer just handles tv shows" :D