File-TVShow-Organize
view release on metacpan or search on metacpan
lib/File/TVShow/Organize.pm view on Meta::CPAN
__END__
=head1 NAME
File::TVShow::Organize - Perl module to move TVShow Files into their
matching Show Folder on a media server.
=head1 VERSION
VERSION 0.360.1
=head1 SYNOPSIS
use File::TVShow::Organize;
our $exceptionList = "S.W.A.T.2017:S.W.A.T 2017|Other:other";
my $obj = File::TVShow::Organize->new();
$obj->new_show_folder("/tmp/");
$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";
exit;
}
# Create a hash for matching file name to Folders
$obj->create_show_hash();
# Delete files are processing.
$obj->delete(1);
# Don't create sub Season folders under the root show name folder.
# Instead just dump them all into the root folder
$obj->season_folder(0);
# Batch process a folder containing TVShow files
$obj->process_new_shows();
# Report any file names which could not be handled automatically.
$obj->were_there_errors();
#end of program
=head1 DESCRIPTION
This module moves TV show files from the folder where they currently exist into the correct folder based on
show name and season.
Folder structure: /base/folder/Castle -> Season1 -> Castle.S01E01.avi
Season2 -> Castle.S02E01.avi
Specials -> Castle.S00E01.avi
This season folder behaviour can be disabled by calling season_folder(0). In this case
all files are simply placed under Castle without sorting into season folders.
Source files are renamed or deleted upon successful relocation.
This depends on the state of delete(). The default is to rename the files and not to delete.
See delete() for more details.
Possible uses might include moving the files from an original rip directory and moving them into the correct
folder structure for media servers such as Plex or Kodi. Another use might be to sort shows that are already
in a single folder and to move them to a season by season or Special folder struture for better folder
management.
This module does not examine file encodings and only parses the initial file naming. "name.SXXEXX.*" anything after
SXXEXX is ignored with the exception that files ending in ".done" are also ignored by the module. These files will
have already been successfully processed in previous executions of code using this module.
Works on Mac OS and *nix systems.
=head1 Methods
=head2 new
Arguments: None or { Exeptions => 'MatchCase:DesiredValue'}
$obj = File::TVShow::Organize->new();
$obj = File::TVShow::Organize->new({ Exceptions =>
'MatchCase:DesiredValue' })
This subroutine creates a new object of type File::TVShow::Organize
If Exceptions is passed to the method we load this data into a hash
for later use to handle naming complications.
E.G file: S.W.A.T.2017.S01E01.avi is not handled correctly by File::TVShow::Info
so we need to know to handle this differently. Exceptions is an optional
parameter and can be left out when calling new().
Currently Exceptions is a scalar string.
Its format is "MatchCase:DesiredValue|MatchCase:DesiredValue"
=head2 countries
Arguments: String: Note the format below is used as part of a regex
check in the module.
As such () should always be included at the start and end of the
string.
$obj->countries("(US|UK|AU)");
$obj->countries();
This subroutine sets the countries internal value and returns it.
Default value: (UK|US)
This allows the system to match against programs names such as
Agent X US / Agent X (US) / Agent X and reference the same single folder
=head2 show_folder
Arguments: None or String
Set the path return undef is the path is invalid
( run in 0.792 second using v1.01-cache-2.11-cpan-71847e10f99 )