Hi Erland,

Thanks for getting back to me.

I think I have figured it out on my own after reading some of your
replies to other users with similar issues.

Basically I've created a modified version of 'Custom Tags Album' XML,
which  enables <menulinks>alpha</menulinks> and adds a third row to the
SQL query - substr(customscan_track_attributes.valuesort,1,1) - to make
the alpha links work.  This gives me the desired result, but if you can
come up with a better way of doing it in a future release then that
would be great!

My biggest frustration at the moment is having to add composer names to
my ARTIST and ARTISTSORT tags in order to be able to search on them in
SC - if only SC would use COMPOSERSORT and CONDUCTORSORT by default, it
would make life so much easier for us classical collectors.

Anyway, here's my custom XML for making a 'Browse Albums by Conductor'
menu, with the CONDUCTORSORT field used as the sort order...


<?xml version="1.0" encoding="utf-8"?>
<custombrowse>
        <menu>
                
                <menuname>Conductors</menuname>
                <menuorder>52</menuorder>
                <menu>
                        <id>customtag</id>
                        <menuname>Albums</menuname>
                        <pathtype>sql</pathtype>
                        <pathtypedata>
                                select distinct
customscan_track_attributes.value,customscan_track_attributes.value
from customscan_track_attributes 
                                                where 
                                                        module='customtag' and
                                                        attr='CONDUCTOR' and
                                                        value='{context.itemid}'
                        </pathtypedata>
                        <menutype>sql</menutype>
                        <menulinks>alpha</menulinks>
                        <menudata>
                                select
customscan_track_attributes.value,customscan_track_attributes.value,substr(customscan_track_attributes.valuesort,1,1)
from customscan_track_attributes 
                                left join customscan_track_attributes as attr2 
on
                                        
customscan_track_attributes.track=attr2.track and
                                        attr2.module='customtag' and
                                        attr2.attr='CONDUCTORSORT'
                                where
                                        
customscan_track_attributes.module='customtag' and
                                        
customscan_track_attributes.attr='CONDUCTOR'
                                group by customscan_track_attributes.value
                                order by
ifnull(attr2.value,ifnull(customscan_track_attributes.valuesort,customscan_track_attributes.value))
asc
                        </menudata>
                        <menu>
                                <id>album</id>
                                <menuname>Songs</menuname>
                                <itemtype>album</itemtype>
                                <itemformat>album</itemformat>
                                <menutype>sql</menutype>
                                <option>
                                        <id>bytitle</id>
                                        <name>Sort by title</name>
                                        <menulinks>alpha</menulinks>
                                        <keyword name="orderby" 
value="albums.titlesort asc,albums.disc
asc"/>
                                </option>
                                <option>
                                        <id>byyear</id>
                                        <name>Sort by year</name>
                                        <menulinks>number</menulinks>
                                        <keyword name="orderby" 
value="albums.year desc,albums.titlesort
asc,albums.disc asc"/>
                                </option>
                                <menudata>
                                        select 
albums.id,albums.title,substr(albums.titlesort,1,1) from
tracks,albums,customscan_track_attributes 
                                        where 
                                                tracks.audio=1 and 
                                                albums.id=tracks.album and 
                                                
tracks.id=customscan_track_attributes.track and
                                                
customscan_track_attributes.module='customtag' and
                                                
customscan_track_attributes.attr='CONDUCTOR' and
                                                
customscan_track_attributes.value='{customtag}' 
                                        group by albums.id 
                                        order by {orderby}
                                </menudata>
                                <menu>
                                        <id>track</id>
                                        <itemtype>track</itemtype>
                                        <itemformat>track</itemformat>
                                        <playtype>all</playtype>
                                        <menutype>sql</menutype>
                                        <menudata>
                                                select tracks.id,tracks.title 
from
tracks,albums,customscan_track_attributes 
                                                where 
                                                        tracks.audio=1 and 
                                                        tracks.album={album} 
and 
                                                        
tracks.id=customscan_track_attributes.track and
                                                        
customscan_track_attributes.module='customtag' and
                                                        
customscan_track_attributes.attr='CONDUCTOR' and
                                                        
customscan_track_attributes.value='{customtag}' 
                                                group by tracks.id 
                                                order by tracks.disc 
asc,tracks.tracknum asc,tracks.titlesort
asc
                                        </menudata>
                                        <menu>
                                                <id>trackdetails</id>
                                                
<menutype>trackdetails</menutype>
                                                <menudata>track|0</menudata>
                                        </menu>
                                </menu>
                        </menu>
                </menu>
        </menu>
</custombrowse>


-- 
Mark153
------------------------------------------------------------------------
Mark153's Profile: http://forums.slimdevices.com/member.php?userid=16426
View this thread: http://forums.slimdevices.com/showthread.php?t=58744

_______________________________________________
plugins mailing list
[email protected]
http://lists.slimdevices.com/lists/listinfo/plugins

Reply via email to