App-Plex-Archiver

 view release on metacpan or  search on metacpan

bin/plex-archiver  view on Meta::CPAN

use Data::Dumper;
use App::Plex::Archiver qw( title_from_filename copy_file get_tmbd_api_key get_tmdb_info );


use Readonly;
use IO::Prompter;

Readonly my %MEDIA_EXT => map { $_ => 1 } qw( mp4 avi mkv mov );


sub ask_yes_or_no { prompt(-yn, @_); }  ## no critic (Subroutines::RequireArgUnpacking)
sub get_input     { prompt((shift // ""), -prefill => (shift // "")); }










lib/App/Plex/Archiver.pm  view on Meta::CPAN

      );
      $idx++;
    }
  }

  my $menu = [];
  for my $movie (@responses) {
    push(@$menu, sprintf("\"%s\" (%s)", $movie->{title}, $movie->{release_year}));
  }
  if (scalar(@$menu)) {
    my $selected = prompt(
      "Matching titles ...",
      -menu => $menu,
      -number,
      "Your choice: "
    );

    my $idx = 0;
    while ($idx < scalar(@$menu)) {
      if ($selected eq $menu->[$idx]) {
        printf("returning id='%s', release_year='%s'\n", $responses[$idx]->{id}, $responses[$idx]->{release_year}) if ($debug);

lib/App/Plex/Archiver.pm  view on Meta::CPAN

=item * L<File::Spec> - Cross-platform file path operations

=item * L<File::Slurp> - Simple file reading

=item * L<File::HomeDir> - User home directory detection

=item * L<Carp> - Error handling

=item * L<Lingua::EN::Titlecase> - Title case formatting

=item * L<IO::Prompter> - Interactive user prompts

=item * L<Readonly> - Read-only variables

=item * L<TMDB> - The Movie Database API integration (external dependency)

=back

=head1 CONSTANTS

=head2 $DEFAULT_TMDB_API_KEY_FILENAME



( run in 2.484 seconds using v1.01-cache-2.11-cpan-6aa56a78535 )