NAME

FixMP3Tags::Processor - Internal processor for fixing MP3 tags

VERSION

Version 0.1.0

SYNOPSIS

use FixMP3Tags::Processor;

FixMP3Tags::Processor->run();

DESCRIPTION

This module implements the processing used by the fix-mp3-tags command-line program. It derives artist and album names from parent directories and the track number and title from filenames, then writes the derived values to an ID3v2 tag.

The command-line program is the intended user interface. This module does not provide an object constructor; its routines are invoked as class methods.

METHODS

run

FixMP3Tags::Processor->run();

Reads command-line options from @ARGV and processes either the file specified by --file or MP3 files found recursively under --directory. The default directory is the current working directory. --help and --version print their information and exit.

process_directory

FixMP3Tags::Processor->process_directory($directory, \%options);

Recursively scans a directory for MP3 files and processes files whose paths match the expected artist/album/track structure. The options hash may contain quiet, dry_run, and pattern. In normal mode, non-quiet runs show a preview and request confirmation before writing tags. With dry_run, the routine returns without changing tags.

process_file

FixMP3Tags::Processor->process_file($file_path, \%options);

Processes one MP3 file. The artist and album are derived from its parent folders; the track number and title are derived from a filename in the form NN.SongName.mp3. The options hash supports quiet, dry_run, and pattern. The routine returns a true value when processing succeeds (or a dry run completes), and a false/undefined value when the file cannot be processed or tag writing fails.

AUTHOR

vr-ski, <166657596+vr-ski@users.noreply.github.com>

LICENSE AND COPYRIGHT

This software is copyright (c) 2025 by vr-ski.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.