Multi-Disc Albums

Artist radio, genre radio & related artists. A Subsonic server for music nerds.

Moderator: moderators

Multi-Disc Albums

Postby rubbersoul » Fri Apr 05, 2013 3:03 pm

Just wondering how or if musiccabinet handles multi-disc albums. Currently, I have multi-disc albums tagged with %discnumber% to differentiate them. Musiccabinet does not recognize this tag, but I'm wondering if it recognizes another tag? At the moment all my multi-disc albums play like this:

disc 1 track 1
disc 2 track 1
disc 1 track 2
disc 2 track 2

One way to handle this is to put the disc number into the album name field, but this is generally frowned upon for last.fm users.
rubbersoul
 
Posts: 127
Joined: Thu Aug 18, 2011 2:27 pm

Re: Multi-Disc Albums

Postby hakko » Fri Apr 05, 2013 3:36 pm

What type of files do you refer to? FLAC, OGG, MP3 etc? Disc number works for me but the exact tag to use will vary depending on file type + tag type (id3, vorbis etc).
MusicCabinet developer
hakko
 
Posts: 1416
Joined: Tue Apr 17, 2012 7:05 pm
Location: Sweden

Re: Multi-Disc Albums

Postby DivBy0 » Fri Apr 05, 2013 9:50 pm

Like hakko noted, I denote the Disc number in the album name within the ID Tag i.e.: "Album" = Frampton Comes Alive, Disc 1 then the next disc's "Album" = Frampton Comes Alive, Disc 2
Ya I know Frampton....well it's a well know 2 disc set. Anyway, this work great for me; and if you want the albums in alphabetical, change the preference "Album sorting" to By Name
DivBy0
 
Posts: 6
Joined: Sat Jan 12, 2013 8:54 pm

Re: Multi-Disc Albums

Postby hakko » Sat Apr 06, 2013 9:29 am

That's not how I do it, I use the disc number tag that beets writes to my files and it gets displayed like this in MusicCabinet:

Image
MusicCabinet developer
hakko
 
Posts: 1416
Joined: Tue Apr 17, 2012 7:05 pm
Location: Sweden

Re: Multi-Disc Albums

Postby rubbersoul » Sat Apr 06, 2013 2:19 pm

OK, my mistake. The disc number tag is working for me also in the web player. It isn't recognized by DSub or Ultrasonic mobile android clients. Would this be a bug on their end then?
rubbersoul
 
Posts: 127
Joined: Thu Aug 18, 2011 2:27 pm

Re: Multi-Disc Albums

Postby hakko » Sat Apr 06, 2013 3:14 pm

Disc number was introduced in the REST API in version 1.8.0. It could be that DSub and Ultrasonic doesn't use this for sorting tracks.

The response for the album above looks like this:

Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<subsonic-response xmlns="http://subsonic.org/restapi" status="ok" version="1.8.0">
  <directory id="-1720" name="(2010) A Bureaucratic Desire for Extra-Capsular Extraction">
    <child id="654337" parent="-1720" title="A Bureaucratic Desire for Revenge, Part 1" album="A Bureaucratic Desire for Extra-Capsular Extraction" artist="Earth" isDir="false" track="1" discNumber="1" year="2010" coverArt="..." size="11742208" contentType="audio/mpeg" suffix="mp3" duration="435" bitRate="214" path="Earth/A Bureaucratic Desire for Extra-Capsular Extraction/1-01 A Bureaucratic Desire for Revenge, Part 1.mp3"/>
    <child id="667287" parent="-1720" title="Geometry of Murder" album="A Bureaucratic Desire for Extra-Capsular Extraction" artist="Earth" isDir="false" track="1" discNumber="2" year="2010" coverArt="..." size="11527522" contentType="audio/mpeg" suffix="mp3" duration="439" bitRate="208" path="Earth/A Bureaucratic Desire for Extra-Capsular Extraction/2-01 Geometry of Murder.mp3"/>

[...]



iSub handles this so you could ask other app developers to have a look at this thread too.
MusicCabinet developer
hakko
 
Posts: 1416
Joined: Tue Apr 17, 2012 7:05 pm
Location: Sweden

Re: Multi-Disc Albums

Postby rubbersoul » Sat Apr 06, 2013 3:30 pm

great, thanks for clearing this up hakko!!
rubbersoul
 
Posts: 127
Joined: Thu Aug 18, 2011 2:27 pm

Re: Multi-Disc Albums

Postby daneren2005 » Sat Apr 06, 2013 3:59 pm

Yah I just haven't done it yet on DSub

Sent from my HTC One X using Tapatalk 2
Developer of DSub for Android
daneren2005
 
Posts: 1709
Joined: Fri Jul 06, 2012 7:52 pm

Re: Multi-Disc Albums

Postby phantom4 » Thu Apr 11, 2013 9:48 pm

hakko wrote:Disc number was introduced in the REST API in version 1.8.0. It could be that DSub and Ultrasonic doesn't use this for sorting tracks.

The response for the album above looks like this:

Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<subsonic-response xmlns="http://subsonic.org/restapi" status="ok" version="1.8.0">
  <directory id="-1720" name="(2010) A Bureaucratic Desire for Extra-Capsular Extraction">
    <child id="654337" parent="-1720" title="A Bureaucratic Desire for Revenge, Part 1" album="A Bureaucratic Desire for Extra-Capsular Extraction" artist="Earth" isDir="false" track="1" discNumber="1" year="2010" coverArt="..." size="11742208" contentType="audio/mpeg" suffix="mp3" duration="435" bitRate="214" path="Earth/A Bureaucratic Desire for Extra-Capsular Extraction/1-01 A Bureaucratic Desire for Revenge, Part 1.mp3"/>
    <child id="667287" parent="-1720" title="Geometry of Murder" album="A Bureaucratic Desire for Extra-Capsular Extraction" artist="Earth" isDir="false" track="1" discNumber="2" year="2010" coverArt="..." size="11527522" contentType="audio/mpeg" suffix="mp3" duration="439" bitRate="208" path="Earth/A Bureaucratic Desire for Extra-Capsular Extraction/2-01 Geometry of Murder.mp3"/>

[...]



iSub handles this so you could ask other app developers to have a look at this thread too.


I don't think iSub handles discNumber yet either. I think it works (at least for the above album) because you're filenames have the disc number in them and sort properly.

Here is the xml for an album that doesn't work for me:

Code: Select all
<subsonic-response xmlns="http://subsonic.org/restapi" status="ok" version="1.8.0">
  <directory id="-22527" name="(2013) Black">
    <child id="208659" parent="-22527" title="Midnight Moon Misery" album="Black" artist="Project Pitchfork" isDir="false" track="1" discNumber="2" year="2013" coverArt="..." size="11504339" contentType="audio/mpeg" suffix="mp3" duration="334" bitRate="273" path="Project Pitchfork/Black/1. Midnight Moon Misery.mp3"/>
    <child id="208551" parent="-22527" title="Pitch-Black" album="Black" artist="Project Pitchfork" isDir="false" track="1" discNumber="1" year="2013" coverArt="..." size="14705459" contentType="audio/mpeg" suffix="mp3" duration="445" bitRate="263" path="Project Pitchfork/Black/1. Pitch-Black.mp3"/>

[...]



It sorts 1, 1, 2, 2, etc (but sorts properly in the web interface).
phantom4
 
Posts: 9
Joined: Thu Aug 25, 2011 6:46 pm

Re: Multi-Disc Albums

Postby vollbr0t » Mon Apr 15, 2013 9:19 am

I think it would be great to have additional buttons to play only one specific cd of multi-disc albums. For example I often want to hear only the first cd, so i have to add the whole album and delete the songs from the second disc...
vollbr0t
 
Posts: 75
Joined: Wed Jan 19, 2011 6:35 pm

Re: Multi-Disc Albums

Postby germain35 » Wed May 15, 2013 8:30 pm

Hi guys,

I just found a solution for multi-Discs Albums display into iSub (which actually doesn't use DiscNumber parameter).

The problem is in the file RESTBrowseController.java, in the definition of trackComparator variable.

The current definition :

Code: Select all
private final Comparator<Track> trackComparator = new Comparator<Track>() {
        @Override
        public int compare(Track t1, Track t2) {
            return Integer.compare(getTrackNr(t1.getMetaData().getTrackNr()),
                    getTrackNr(t2.getMetaData().getTrackNr()));
        }

        private int getTrackNr(Short nr) {
            return nr == null ? 0 : nr.intValue();
        }
    };


with this method, the rest response is sorted only on trackNumber parameter, so when you call a multi-disc album, it returns tracks sorted like this : 1, 1, 2, 2, 3, 3...

To correct this issue, we need to use discNumber parameter and trackNumber parameters together.

So, the idea is to concatenate discNumber and trackNumber (formatted with 2 digits).

For exemple for the first track of the first disc, we will have 0101 and for the first track of the second disc, we'l have 0201 which is greater than 0101, the rest response is now correctly sorted by changing the variable definition like this :

Code: Select all
private final Comparator<Track> trackComparator = new Comparator<Track>() {
        @Override
        public int compare(Track t1, Track t2) {
            //germain
            Short x1 = Short.valueOf(String.format("%02d", t1.getMetaData().getDiscNr()).concat(String.format("%02d", t1.getMetaData().getTrackNr())));
            Short x2 = Short.valueOf(String.format("%02d", t2.getMetaData().getDiscNr()).concat(String.format("%02d", t2.getMetaData().getTrackNr())));
            return Integer.compare(x1,x2);
            //germain
        }

        private int getTrackNr(Short nr) {
            return nr == null ? 0 : nr.intValue();
        }
    };
germain35
 
Posts: 10
Joined: Mon Sep 12, 2011 12:23 pm

Re: Multi-Disc Albums

Postby rmnma » Thu May 16, 2013 7:35 am

@Germain35 Can you give me a roadmap how to edit this? I cannot find the file RESTBrowseController.java.
Do I need Java Platform (JDK) 7u21 for this?
rmnma
 
Posts: 30
Joined: Mon Feb 04, 2013 6:46 pm

Re: Multi-Disc Albums

Postby germain35 » Thu May 16, 2013 2:24 pm

@rmnma

I use the 7u21 JDK to compile under Ubuntu server 12.04 64bits and I have the tomcat version of MusicCabinet.

Roadmap to patch MusicCabinet under linux:

- Download RESTBrowseController.java from Hakko GitHub :
https://github.com/hakko/subsonic/blob/master/subsonic-main/src/main/java/net/sourceforge/subsonic/controller/RESTBrowseController.java

- Modify the code like this (trackComparator variable definiton ) :
Code: Select all
private final Comparator<Track> trackComparator = new Comparator<Track>() {
        @Override
        public int compare(Track t1, Track t2) {
            //germain
            Short x1 = Short.valueOf(String.format("%02d", t1.getMetaData().getDiscNr()).concat(String.format("%02d", t1.getMetaData().getTrackNr())));
            Short x2 = Short.valueOf(String.format("%02d", t2.getMetaData().getDiscNr()).concat(String.format("%02d", t2.getMetaData().getTrackNr())));
            return Integer.compare(x1,x2);
            //germain
        }

        private int getTrackNr(Short nr) {
            return nr == null ? 0 : nr.intValue();
        }
    };


- To compile, you need to specify the library directory of MusicCabinet, the servlet library that you can find in the tomcat's library directory and the class directory of MusicCabinet (in WEB-INF), the command looks like this :
Code: Select all
TOMCAT_DIRECTORY=...
javac -Xlint:unchecked -cp $(echo ${TOMCAT_DIRECTORY}/webapps/subsonic/WEB-INF/lib/*.jar | tr ' ' ':'):${TOMCAT_DIRECTORY}/lib/servlet-api.jar:${TOMCAT_DIRECTORY}/webapps/subsonic/WEB-INF/classes RESTBrowseController.java


2 classes are generated : RESTBrowseController.class and RESTBrowseController$1.class.

- Stop tomcat
- Copy thoses 2 classes into ${TOMCAT_DIRECTORY}/webapps/subsonic/WEB-INF/classes/net/sourceforge/subsonic/controller/
- Start tomcat
germain35
 
Posts: 10
Joined: Mon Sep 12, 2011 12:23 pm

Re: Multi-Disc Albums

Postby rmnma » Thu May 16, 2013 5:50 pm

Thank you!
rmnma
 
Posts: 30
Joined: Mon Feb 04, 2013 6:46 pm


Return to MusicCabinet

Who is online

Users browsing this forum: No registered users and 26 guests