Sign in to PrePAN

File-TVShow-Organize Video file migration module to handle TV Shows.




  use strict;
  use warnings;

  use File::TVShow::Organize;

  my $obj = File::TVShow::Organize->new({exception list => 'S.W.A.T|S.W.A.T'});

  $obj->show_folder("/absolute/path/to/TV Shows");

  if((!defined $obj->new_show_folder()) || (!defined $obj->show_folder())) {
    print "Verify your paths. Something in wrong\n";

  # Create a hash for matching file name to Folders

  # Delete files after processing. The default is to rename the files by appending ".done"

  # Do not create sub folders under the the show's parent folder. All files should be dumped
  # into the parent folder. The default is to create season folders.

  # Batch process a folder containing TV Show files

  # Report any file names which could not be handled automatically.

  #end of program


I wrote this module in order for me automate my personal Video library rip and import work flow.

The idea being that dvds would be ripped into a staging folder. The files would be named according to Season and Episode format. The resulting file would then be moved into the correct show/season folder automatically. This is done as a cron job.

The module's role is to allow someone to create their own programs to to carry out these actions. Taking care of details such as matching show name to destination folder, create the required season folder if it does not exist and calling rsync to migrate the video file to its new home.


This module has been renamed and method names have been changed to snake_case


This looks pretty neat. To make things a bit more OO, I might suggest removing the `$::exceptionList` global variable and instead passing that in to the `new()` method. I'd also remove the `Exporter` / `@EXPORT` stuff, as object classes shouldn't also export subs (and you're not doing any exporting).

You do a lot of reading from directories. It might be less code / easier to use the Path::Tiny module for that.

I also have a bunch of scripts that help me organize my media library. You may find something useful there:
Thanks. I will take a look at those ideas. I wasn't sure how I wanted to handle the exception list. But you have a good point about moving away from the global. It was a quick fix that as usual becomes a fixture.
I am also looking for some feedback on if the current module name makes sense or if TVShow::Import should be replaced with something better. I feel comfortable with the prefix Video::File

Please sign up to post a review.