Ticket #7674: fix-video-artwork.diff

File fix-video-artwork.diff, 2.0 KB (added by Simon Kenyon <simon@…>, 14 years ago)

small patch to classes/Video.php which changes assumption that coverart path is stored in the database to just the filename

Line 
1*** /root/myth/trunk/mythplugins/mythweb/classes/Video.php      2010-01-13 14:37:23.000000000 +0000
2--- Video.php   2010-01-16 20:25:06.000000000 +0000
3***************
4*** 56,63 ****
5          $this->cover_file   = $video['coverfile'];
6          $this->browse       = $video['browse'];
7      // And the artwork URL
8!         if ($this->cover_file != 'No Cover' && file_exists($this->cover_file) ) {
9!             $this->cover_url = 'data/video_covers/'.substr($this->cover_file, strlen(setting('VideoArtworkDir', hostname)));
10              list($width, $height) = @getimagesize($this->cover_file);
11              if ($width > 0 && $height > 0) {
12                  $wscale = video_img_width / $width;
13--- 56,64 ----
14          $this->cover_file   = $video['coverfile'];
15          $this->browse       = $video['browse'];
16      // And the artwork URL
17!         if ($this->cover_file != 'No Cover'  && file_exists(setting('VideoArtworkDir', hostname).'/'.$this->cover_file)) {
18!             $this->cover_url = 'data/video_covers/'.$this->cover_file;
19!             $this->cover_file = setting('VideoArtworkDir', hostname).'/'.$this->cover_file;
20              list($width, $height) = @getimagesize($this->cover_file);
21              if ($width > 0 && $height > 0) {
22                  $wscale = video_img_width / $width;
23***************
24*** 146,152 ****
25                      $this->length,
26                      $this->showlevel,
27                      $this->filename,
28!                     ( @filesize($this->cover_file) > 0 ? $this->cover_file : 'No Cover' ),
29                      $this->browse,
30                      $this->intid
31                      );
32--- 147,153 ----
33                      $this->length,
34                      $this->showlevel,
35                      $this->filename,
36!                     ( @filesize(setting('VideoArtworkDir', hostname).'/'.$this->cover_file) > 0 ? $this->cover_file : 'No Cover' ),
37                      $this->browse,
38                      $this->intid
39                      );