| 1 | package Net::DAAP::Server; | ||||||||||
| 2 | 2 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 2 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 2 | ▶ | use Net::DAAP::Server::Track; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 2 | ▶ | use File::Find::Rule; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 2 | ▶ | use base qw( Net::DMAP::Server ); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | 2 | our $VERSION = '0.03'; | |||||||||
| 8 | |||||||||||
| 9 | 0 | ▶ | sub protocol { 'daap' } | ||||||||
|
Subroutine
protocol: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 10 | |||||||||||
| 11 | 0 | ▶ | sub default_port { 3689 } | ||||||||
|
Subroutine
default_port: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 12 | |||||||||||
| 13 | 0 | ▶ | sub find_tracks { | ||||||||
|
Subroutine
find_tracks: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||
| 14 | 0 | my $self = shift; | |||||||||
| 15 | 0 | for my $file ( find name => "*.mp3", in => $self->path ) { | |||||||||
| 16 | 0 | ▶ | my $track = Net::DAAP::Server::Track->new_from_file( $file ) or next; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 17 | 0 | $self->tracks->{ $track->dmap_itemid } = $track; | |||||||||
| 18 | } | ||||||||||
| 19 | } | ||||||||||
| 20 | |||||||||||
| 21 | 0 | ▶ | sub server_info { | ||||||||
|
Subroutine
server_info: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 22 | 0 | my ($self, $request, $response) = @_; | |||||||||
| 23 | 0 | $response->content( $self->_dmap_pack( | |||||||||
| 24 | [[ 'dmap.serverinforesponse' => [ | ||||||||||
| 25 | [ 'dmap.status' => 200 ], | ||||||||||
| 26 | [ 'dmap.protocolversion' => 2 ], | ||||||||||
| 27 | [ 'daap.protocolversion' => | ||||||||||
| 28 | $request->header('Client-DAAP-Version') ], | ||||||||||
| 29 | [ 'dmap.itemname' => $self->name ], | ||||||||||
| 30 | [ 'dmap.loginrequired' => 0 ], | ||||||||||
| 31 | [ 'dmap.timeoutinterval' => 1800 ], | ||||||||||
| 32 | [ 'dmap.supportsautologout' => 0 ], | ||||||||||
| 33 | [ 'dmap.supportsupdate' => 0 ], | ||||||||||
| 34 | [ 'dmap.supportspersistentids' => 0 ], | ||||||||||
| 35 | [ 'dmap.supportsextensions' => 0 ], | ||||||||||
| 36 | [ 'dmap.supportsbrowse' => 0 ], | ||||||||||
| 37 | [ 'dmap.supportsquery' => 0 ], | ||||||||||
| 38 | [ 'dmap.supportsindex' => 0 ], | ||||||||||
| 39 | [ 'dmap.supportsresolve' => 0 ], | ||||||||||
| 40 | [ 'dmap.databasescount' => 1 ], | ||||||||||
| 41 | ]]] )); | ||||||||||
| 42 | } | ||||||||||
| 43 | |||||||||||
| 44 | |||||||||||
| 45 | 2 | 1; | |||||||||
| 46 | __END__ | ||||||||||