[mythtv-users] Alternative to music section of mythweb

Josh Burks dotnofoolin at gmail.com
Sat Apr 1 15:59:26 UTC 2006


On 4/1/06, John Armstrong <ja at ggrove.plus.com> wrote:
> Partly as an exercise in learning how to use php, and partly because I
> wanted an easier way to alter the ratings for music in mythmusic, I wrote
> myself a php page which others might find useful and can be downloaded here:
> www.ggrove.plus.com/music.php
> Just needs saving in the htdocs directory
> Features:
> Lists artists (optionally grouped by initials), giving average rating and
> number of tracks
> Lists albums by an artist (optionally showing all tracks), giving average
> rating and number of tracks
> Shows album art
> Ratings can be changed, either for an individual track or for a whole album
> Lists playlists and smart playlists
> Some other auto lists
> tracks can be downloaded
>
> It is separate from mythweb, although it does use a couple of stylesheets
> from mythweb to give the same look and feel.
>
> I didn't write it with portability in mind as it was intended for my own
> use, but only a few changes are likely to be needed to make it work
> elsewhere:
> database settings are at line 73
> address for the stylesheets at line 18,19
> it assumes that the mp3 music directory is linked to mp3 in the web folder
> (for downloads), line 447
> it assumes that albums are in the directory "mp3/albumname" or "mp3/year -
> albumname" for the albumart, and only looks for albumart in the file
> "folder_large.jpg", lines 339-346
> I've used a rating of 0 as an ignore flag for duplicate tracks
>
> As it was a learning exercise, I'm sure that some of the coding could be
> improved.
>

One thing I changed is I removed the URL hard coding. I didn't want to
clobber the music.php that came with MythWeb, and you had music.php in
all your links, so I did the following search and replace in vi to
change the file (sorry, I'm not familar with patch):

:94,104s/music.php/<?php \$_SERVER\[\'PHP_SELF\'\] ?>/g
:114,$s/music.php/" \. \$_SERVER\[\'PHP_SELF\'\] \. "/g

Now I can name the file anything I want, such as musicv2.php and all
the links work.

Josh


More information about the mythtv-users mailing list