Quantcast
Channel: Squeezebox : Community : Forums - 3rd Party Software
Viewing all articles
Browse latest Browse all 2059

How i get the LibraryDemo plugin to work

$
0
0
This is written for *ux Systems for the paths used by other OS look @ http://wiki.slimdevices.com/index.ph...file_locations

  • copy the whole Folder /usr/share/perl5/Slim/Plugin/LibraryDemo
    Otherwise your plugin / Work will be lost after a LMS Upgrade
  • to /usr/sbin/Plugins/
  • go to /usr/sbin/Plugins/yoursubfolder
  • change the id from install.xml to something unique (didnt find the mimik so i only changed some chars)
  • change in install.xml <name> to your specs - otherwise you would not find your plugin in the UI.
  • change <module> to your path :: is the delimiter for paths/Folders
  • change <importmodule> to the same as you changed <module>


Now comes the tricky part..
Remember to change everything in all three files - so a editor with search & replace is a good idea for the first try.

Plugin.pm

Since my kids Music and audiobooks are stored in subfolders i'd change the sql statement to:
The Music is stored in Kinderlieder:

Code:

foreach ( {
                id => 'Kinderlieder',
                name => 'Kinderlieder',
                # %s is being replaced with the library's ID
                sql => qq{
                        INSERT OR IGNORE INTO library_track (library, track)
                                SELECT '%s', tracks.id
                                FROM tracks
                                WHERE tracks.url LIKE '%%Kinderlieder%%'
                }

The Audiobooks are stored in Hoerbuch/Amelie:
Since i also got Artists with Amelie or Albums with Amelie, i use a double WHERE Statement to only fetch both matches.

Code:

{
                id => 'Kinder_Hoerbuecher',
                name => 'Kinder Hoerbuecher',
                sql => qq{
                        INSERT OR IGNORE INTO library_track (library, track)
                                SELECT '%s', tracks.id
                                FROM tracks
                                WHERE tracks.url LIKE '%%Hoerbuch%%' AND tracks.url LIKE '%%Amelie%%'
                }
        }

to get a menu in the UI:
Code:

my @menue_1 = ( {
                name => 'PLUGIN_AMELIE_LIBRARY_ALBUMS',
                icon => 'html/images/albums.png',
                feed => \&Slim::Menu::BrowseLibrary::_albums,
                id  => 'Kinderlieder Alben',
                weight => 25,
        }
        );
         
        my @menue_2 = ({
                name => 'PLUGIN_AMELIE_LIBRARY_SPEECH',
                icon => 'html/images/albums.png',
                feed => \&Slim::Menu::BrowseLibrary::_albums,
                id  => 'Kinder_Hoerbuecher',
                weight => 30,
        }
        );

since i use two different sublibrarys i changed the registernode to this

Code:

foreach (@menue_1) {
                Slim::Menu::BrowseLibrary->registerNode({
                        type        => 'link',
                        name        => $_->{name},
                        params      => { library_id => Slim::Music::VirtualLibraries->getRealId('Kinderlieder') },
feed        => $_->{feed},
                        icon        => $_->{icon},
                        jiveIcon    => $_->{icon},
                        homeMenuText => $_->{name},
                        condition    => \&Slim::Menu::BrowseLibrary::isEnabledNode,
                        id          => $_->{id},
                        weight      => $_->{weight},
                        cache        => 1,
                });
        }
       
        foreach (@menue_2) {
                Slim::Menu::BrowseLibrary->registerNode({
                        type        => 'link',
                        name        => $_->{name},
                        params      => { library_id => Slim::Music::VirtualLibraries->getRealId('Kinder_Hoerbuecher') },
                        feed        => $_->{feed},
                        icon        => $_->{icon},
                        jiveIcon    => $_->{icon},
                        homeMenuText => $_->{name},
                        condition    => \&Slim::Menu::BrowseLibrary::isEnabledNode,
                        id          => $_->{id},
                        weight      => $_->{weight},
                        cache        => 1,
                });
        }

Change also everything you changed in the strings.txt!
Stop LMS
start it and do a rescan.

Hopefully i didnt forget something

Viewing all articles
Browse latest Browse all 2059

Trending Articles