File: Movie.pm

package info (click to toggle)
xmltv 1.4.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 9,396 kB
  • sloc: perl: 37,189; xml: 5,017; sh: 153; makefile: 18
file content (112 lines) | stat: -rw-r--r-- 2,959 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
#
# Lightweight package to retrieve movie/tv programme data from The Movie Database (http://www.themoviedb.org/ )
#
# This is a custom version of the CPAN package :
#   WWW::TMDB::API - TMDb API (http://api.themoviedb.org) client
#   Version 0.04 (2012)
#   Author Maria Celina Baratang, <maria at zambale.com>
#   https://metacpan.org/pod/WWW::TMDB::API
#
# Modified for XMLTV use to 
#  - fix broken methods
#  - add methods for TV programmes, and Configuration
#  - 'version' changed to be 0.05
#
# Modifications: Geoff Westcott, December 2021
#

# Package changes for XMLTV
#  - search() - now 'movie'(not 'movies')
#  - search() - added 'year' attribute
#  - casts()  - now called 'credits'
#  - images() - add 'include_image_language' 
#  - latest() - endpoint is now 'movie/latest'
#  - releases()- now called release_dates()
#  - trailers()- now called videos()
#  - info()   - add 'append_to_response' param
#  - reviews()- new endpoint 

package XMLTV::TMDB::API::Movie;

use strict;
use warnings;
our $VERSION = '0.05';

sub info {
    my $self = shift;
    my (%params) = @_;
    $self->{api}->send_api( [ 'movie', $params{ID} ],
        { ID => 1, language => 0, append_to_response =>0 }, \%params );
}

sub search {
    my $self = shift;
    my (%params) = @_;
    $self->{api}->send_api( [ 'search', 'movie' ],
        { query => 1, page => 0, language => 0, 'include_adult' => 0, year => 0 },
        \%params );
}

sub alternative_titles {
    my $self = shift;
    my (%params) = @_;
    $self->{api}->send_api( [ 'movie', $params{ID}, 'alternative_titles' ],
        { ID => 1, country => 0 }, \%params );
}

sub credits {
    my $self = shift;
    my (%params) = @_;
    $self->{api}->send_api( [ 'movie', $params{ID}, 'credits' ], { ID => 1 },
        \%params );
}

sub images {
    my $self = shift;
    my (%params) = @_;
    $self->{api}->send_api( [ 'movie', $params{ID}, 'images' ],
        { ID => 1, language => 0, include_image_language => 0 }, \%params );
}

sub keywords {
    my $self = shift;
    my (%params) = @_;
    $self->{api}->send_api( [ 'movie', $params{ID}, 'keywords' ],
        { ID => 1 }, \%params );
}

sub release_dates {
    my $self = shift;
    my (%params) = @_;
    $self->{api}->send_api( [ 'movie', $params{ID}, 'release_dates' ],
        { ID => 1 }, \%params );
}

sub translations {
    my $self = shift;
    my (%params) = @_;
    $self->{api}->send_api( [ 'movie', $params{ID}, 'translations' ],
        { ID => 1 }, \%params );
}

sub videos {
    my $self = shift;
    my (%params) = @_;
    $self->{api}->send_api( [ 'movie', $params{ID}, 'videos' ],
        { ID => 1, language => 1 }, \%params );
}

sub reviews {
    my $self = shift;
    my (%params) = @_;
    $self->{api}->send_api( [ 'movie', $params{ID}, 'reviews' ],
        { ID => 1, language => 1 }, \%params );
}

sub latest {
    my $self = shift;
    my (%params) = @_;
    $self->{api}->send_api( [ 'movie', 'latest' ] );
}

1;