Beispiel #1
0
        public int CompareTo(MPDTrack other)
        {
            if (other == null)
            {
                return(-1);
            }

            String title = Path;

            String[] pathSplit = title.Split('/');
            if (pathSplit.Length > 0)
            {
                title = pathSplit[pathSplit.Length - 1];
            }


            String titleAnother = Path;

            String[] pathSplitAnother = title.Split('/');
            if (pathSplit.Length > 0)
            {
                titleAnother = pathSplit[pathSplit.Length - 1];
            }

            return(string.Compare(title.ToLower(), titleAnother.ToLower()));
        }
Beispiel #2
0
 public int IndexCompare(MPDTrack compFile)
 {
     if (!AlbumMusicbrainzID.Equals(compFile.AlbumMusicbrainzID))
     {
         return(AlbumMusicbrainzID.CompareTo(compFile.AlbumMusicbrainzID));
     }
     // Compare disc numbers first
     if (DiscNumber > compFile.DiscNumber)
     {
         return(1);
     }
     else if (DiscNumber == compFile.DiscNumber)
     {
         // Compare track number field
         if (AlbumTrackNumber > compFile.AlbumTrackNumber)
         {
             return(1);
         }
         else if (AlbumTrackNumber == compFile.AlbumTrackNumber)
         {
             return(0);
         }
         else
         {
             return(-1);
         }
     }
     else
     {
         return(-1);
     }
 }