? bug552.diff
Index: strings.txt
===================================================================
RCS file: /home/cvs/cvsroot/slim/server/strings.txt,v
retrieving revision 1.138
diff -u -p -B -r1.138 strings.txt
--- strings.txt 23 Sep 2004 01:27:28 -0000 1.138
+++ strings.txt 23 Sep 2004 06:34:44 -0000
@@ -5013,6 +5013,9 @@ BPM
EN Beats Per Minute
FR Bats par Minute
+DRM
+ EN This file is locked by Digital Rights Management
+
YEAR
DE Jahr
DK År
Index: CPAN/Audio/WMA.pm
===================================================================
RCS file: /home/cvs/cvsroot/slim/server/CPAN/Audio/WMA.pm,v
retrieving revision 1.5
diff -u -p -B -r1.5 WMA.pm
--- CPAN/Audio/WMA.pm 6 Mar 2004 17:08:04 -0000 1.5
+++ CPAN/Audio/WMA.pm 23 Sep 2004 06:34:45 -0000
@@ -140,6 +140,12 @@ sub _parseWMAHeader {
next;
}
+ if ($nextObjectGUIDName eq 'GETID3_ASF_Content_Encryption_Object') {
+
+ $self->_parseASFContentEncryptionObject();
+ next;
+ }
+
if ($nextObjectGUIDName eq 'GETID3_ASF_Extended_Content_Description_Object') {
$self->_parseASFExtendedContentDescriptionObject();
@@ -199,6 +205,12 @@ sub _parseASFFilePropertiesObject {
$self->{'INFO'} = \%info;
}
+sub _parseASFContentEncryptionObject {
+ my $self = shift;
+
+ $self->{'INFO'}->{'drm'} = 1;
+}
+
sub _parseASFContentDescriptionObject {
my $self = shift;
Index: HTML/Default/songinfo.html
===================================================================
RCS file: /home/cvs/cvsroot/slim/server/HTML/Default/songinfo.html,v
retrieving revision 1.13
diff -u -p -B -r1.13 songinfo.html
--- HTML/Default/songinfo.html 11 Sep 2004 04:27:17 -0000 1.13
+++ HTML/Default/songinfo.html 23 Sep 2004 06:34:53 -0000
@@ -136,6 +136,11 @@
[% "MODTIME" | string %][% "COLON" | string %] |
[% modtime | html %] |
+ [% END %] [% IF drm %]
+
+ [% "NOTE" | string %] |
+ [% "DRM" | string %] |
+
[% END %] [% IF coverart %]
[% "COVERART" | string %][% "COLON" | string %] |
Index: HTML/EN/songinfo.html
===================================================================
RCS file: /home/cvs/cvsroot/slim/server/HTML/EN/songinfo.html,v
retrieving revision 1.9
diff -u -p -B -r1.9 songinfo.html
--- HTML/EN/songinfo.html 11 Sep 2004 04:27:18 -0000 1.9
+++ HTML/EN/songinfo.html 23 Sep 2004 06:34:53 -0000
@@ -176,7 +176,18 @@
[% modtime | html %]
- [% END %] [% IF coverart %]
+ [% END %]
+ [% IF drm %]
+
+
+ [% "NOTE" | string %]
+ |
+
+ [% "DRM" | string %]
+ |
+
+ [% END %]
+ [% IF coverart %]
[% "COVERART" | string %] |
 |
Index: HTML/Fishbone/songinfo.html
===================================================================
RCS file: /home/cvs/cvsroot/slim/server/HTML/Fishbone/songinfo.html,v
retrieving revision 1.17
diff -u -p -B -r1.17 songinfo.html
--- HTML/Fishbone/songinfo.html 6 Aug 2004 04:16:58 -0000 1.17
+++ HTML/Fishbone/songinfo.html 23 Sep 2004 06:34:54 -0000
@@ -179,6 +179,16 @@
[% modtime | html %] |
[% END %]
+ [% IF drm %]
+
+
+ [% "NOTE" | string %]
+ |
+
+ [% "DRM" | string %]
+ |
+
+ [% END %]
[% IF itempath %]
Index: Slim/Buttons/TrackInfo.pm
===================================================================
RCS file: /home/cvs/cvsroot/slim/server/Slim/Buttons/TrackInfo.pm,v
retrieving revision 1.13
diff -u -p -B -r1.13 TrackInfo.pm
--- Slim/Buttons/TrackInfo.pm 3 Aug 2004 17:29:11 -0000 1.13
+++ Slim/Buttons/TrackInfo.pm 23 Sep 2004 06:34:57 -0000
@@ -281,6 +281,11 @@ sub preloadLines {
push (@{$client->trackInfoContent}, undef);
}
+ if (Slim::Music::Info::digitalrights($url)) {
+ push (@{$client->trackInfoLines}, Slim::Utils::Strings::string('DRM'));
+ push (@{$client->trackInfoContent}, undef);
+ }
+
}
#
Index: Slim/Formats/WMA.pm
===================================================================
RCS file: /home/cvs/cvsroot/slim/server/Slim/Formats/WMA.pm,v
retrieving revision 1.5
diff -u -p -B -r1.5 WMA.pm
--- Slim/Formats/WMA.pm 23 Sep 2004 02:20:40 -0000 1.5
+++ Slim/Formats/WMA.pm 23 Sep 2004 06:34:57 -0000
@@ -1,6 +1,6 @@
package Slim::Formats::WMA;
-# $Id: WMA.pm,v 1.5 2004/09/23 02:20:40 kdf Exp $
+# $Id: WMA.pm,v 1.4 2004/02/09 19:00:07 dean Exp $
# SlimServer Copyright (c) 2001-2004 Sean Adams, Slim Devices Inc.
# This program is free software; you can redistribute it and/or
@@ -50,6 +50,7 @@ sub getTag {
$tags->{'RATE'} = $wma->info('max_bitrate');
# WMA bitrate is reported in kbps
$tags->{'BITRATE'} = $wma->info('bitrate')*1000;
+ $tags->{'DRM'} = $wma->info('drm');
# not supported yet - slimserver doesn't appear to use them anyways
#$tags->{'STEREO'} = $wma->info('channels') == 2 ? 1 : 0;
Index: Slim/Music/Info.pm
===================================================================
RCS file: /home/cvs/cvsroot/slim/server/Slim/Music/Info.pm,v
retrieving revision 1.146
diff -u -p -B -r1.146 Info.pm
--- Slim/Music/Info.pm 23 Sep 2004 01:35:32 -0000 1.146
+++ Slim/Music/Info.pm 23 Sep 2004 06:34:58 -0000
@@ -83,6 +83,7 @@ my @infoCacheItems = (
'VALID', # 0 - entry not checked, 1 - entry checked and valid. Used to find stale entries in the cache
'TTL', # Time to Live for Cache Entry
'BPM', # Beats per minute
+ 'DRM', # Digital Rights Management
);
# Save the persistant DB cache every hour
@@ -1439,6 +1440,8 @@ sub bitrate {
}
}
+sub digitalrights { return info(shift,'DRM'); }
+
sub bitratenum { return info(shift,'BITRATE'); }
sub samplerate { return info(shift,'RATE'); }
Index: Slim/Player/Source.pm
===================================================================
RCS file: /home/cvs/cvsroot/slim/server/Slim/Player/Source.pm,v
retrieving revision 1.114
diff -u -p -B -r1.114 Source.pm
--- Slim/Player/Source.pm 23 Sep 2004 01:57:17 -0000 1.114
+++ Slim/Player/Source.pm 23 Sep 2004 06:34:58 -0000
@@ -802,6 +802,12 @@ sub errorOpening {
my $line2 = Slim::Music::Info::standardTitle($client, Slim::Player::Playlist::song($client));
$client->showBriefly($line1, $line2, 1,1);
+ Slim::Buttons::Common::param($client,'noUpdate',1);
+ Slim::Utils::Timers::setTimer($client,Time::HiRes::time() + 1,\&errorDone)
+}
+
+sub errorDone {
+ Slim::Buttons::Common::param(shift,'noUpdate',0);
}
sub openSong {
@@ -904,7 +910,7 @@ sub openSong {
$filepath = $fullpath;
}
- my ($size, $duration, $offset, $samplerate, $blockalign, $endian) = (0, 0, 0, 0, 0, undef);
+ my ($size, $duration, $offset, $samplerate, $blockalign, $endian,$drm) = (0, 0, 0, 0, 0, undef,undef);
# don't try and read this if we're a pipe
unless (-p $filepath) {
@@ -916,12 +922,20 @@ sub openSong {
$samplerate = Slim::Music::Info::samplerate($fullpath);
$blockalign = Slim::Music::Info::blockalign($fullpath);
$endian = Slim::Music::Info::endian($fullpath) || '';
+ $drm = Slim::Music::Info::digitalrights($fullpath);
$::d_source && msg(
"openSong: getting duration $duration, size $size, endian " .
"$endian and offset $offset for $fullpath\n"
);
+ if ($drm) {
+
+ $::d_source && msg("openSong: $fullpath is rights protected. skipping.\n");
+ errorOpening($client);
+ return undef;
+ }
+
if (!$size || !$duration) {
$::d_source && msg("openSong: not bothering opening file with zero size or duration\n");
Index: Slim/Web/Pages.pm
===================================================================
RCS file: /home/cvs/cvsroot/slim/server/Slim/Web/Pages.pm,v
retrieving revision 1.100
diff -u -p -B -r1.100 Pages.pm
--- Slim/Web/Pages.pm 11 Sep 2004 04:27:31 -0000 1.100
+++ Slim/Web/Pages.pm 23 Sep 2004 06:34:59 -0000
@@ -1057,6 +1057,7 @@ sub _addSongInfo {
$params->{'tagversion'} = Slim::Music::Info::tagVersion($song);
$params->{'mixable'} = Slim::Music::Info::isSongMixable($song);
$params->{'bitrate'} = Slim::Music::Info::bitrate($song);
+ $params->{'drm'} = Slim::Music::Info::digitalrights($song);
# handle artwork bits
my ($body, $type, $mtime) = Slim::Music::Info::coverArt($song,'cover');