Author Topic: [SOLVED] Synced autoplaylists do not reflect sort order  (Read 4640 times)

theta_wave

  • Sr. Member
  • ****
  • Posts: 680
I'm syncing autoplaylists from MB (3.0.5887) to a microSD; on the latter, they are just regular playlists.  When comparing the output of an exported MB autoplaylist to the one synced on the microSD, it is clear that the sort order of the former is not reflected in the latter.

Here's the playlist on MB:
http://pastebin.com/ugTx3M9C

Here's the playlist on the microSD:
http://pastebin.com/8URqtJhE
Last Edit: May 03, 2016, 10:32:01 PM by ssri

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34312
when you say exported you mean the playlist is included in the device synchronisation settings, and so exported to the device?
its working fine for me and i see no reason for it not to work

theta_wave

  • Sr. Member
  • ****
  • Posts: 680
when you say exported you mean the playlist is included in the device synchronisation settings, and so exported to the device?
its working fine for me and i see no reason for it not to work
Correct with respect to the syncing scenario.  It is weird because half of the playlists exported to a device (here, a microSD card in its caddy showing up as a regular drive) are sorted fine and the other half is not.  Just looking at my autoplaylists now, it appears that the ones whose "music track source" is the main music library (#1) is sorted correctly on the microSD card; if the "music track source" is another playlist (#2), then the sorting in the exported playlist is jumbled from what was set in MB. 

#1) The sort order of this synced autoplaylist is identical between MB and the device:


#2) The sort order of this synced autoplaylist is different between MB and the device:


Lastly, there doesn't appear to be anything weird about my device's playlist settings:
Path: Music\00_Playlists\
Format: M3U
Path prefix for tracks: \

EDIT:  Tested a few playlists on a virtual device.  Hmmm, I may be wrong in my conclusion because one autoplaylist escaped my attention.  That autoplaylist's sort order is also set to the main music library,  it's criteria included finding the term "Harmonica" in a custom tag and selecting those whose rating is at least 4 stars.  The resulting playlist synced to the virtual device revealed a sort order different from the same autoplaylist exported (File > Playlist > Export Playlist).  This is weird.
Last Edit: February 16, 2016, 12:42:39 AM by ssri

theta_wave

  • Sr. Member
  • ****
  • Posts: 680
I still believe that this is an issue with respect to autoplaylist syncing to removable devices.  I believe the EDIT in my last post reflected playlists exported to the desktop, which are all properly sorting based on user-defined criteria. 

I get two separate autoplaylist track sorting when exporting said autoplaylist to the desktop versus allowing it to sync to a device (again, just a simple microSD card).  An autoplaylist exported to the desktop reflects user-defined sorting properly whereas said autoplaylist synced to the device is sorted by <Album>.  Without fail, this error arises with autoplaylists that have a different autoplaylist set as its "music track source".  I do not see this error with autoplaylists having the music library as their "music track source".

For example

Playlist name: Blues
Music Track Source: Genre\Blues
Rules: Rating >3.5 stars
Sorting: Artist / Year / Month.Day / Album

Desktop export (proper sorting): http://pastebin.com/N42iPNfu
microSD synced (album sorted): http://pastebin.com/VLmLujQC
Last Edit: May 03, 2016, 08:17:10 AM by ssri

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34312
i will need you to run a debug version so i can get to the bottom of what is going on

theta_wave

  • Sr. Member
  • ****
  • Posts: 680
i will need you to run a debug version so i can get to the bottom of what is going on
Thanks for responding.  I'll await the link for the debug version.  Together with the link are there any additional instructions (i.e. location of any logs that need to be sent your way)?

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34312
could you run this version (replace the existing MusicBee.exe)
http://www.mediafire.com/download/qdzdpmqmomlgt7p/MusicBeeDebug_Sync.zip

and send me the new info created at the end of the error log when you do a sync

theta_wave

  • Sr. Member
  • ****
  • Posts: 680
Thanks Steven for the providing debug version.  With it, I believe I figured out what was the problem.  Go to the end for a TL;DR version.

Errorlog.dat output during syncing: https://ptpb.pw/F2u5

As expected it seems that some autoplaylists sorted properly:

Code
Artist:Ascending, Year (yyyy):Ascending, DateFilled:Ascending, Album:Ascending, 

and others did not:

Code
Album:Ascending, 

I believe that the error lies with the autoplaylist files themselves.

Here are two playlists that sort properly:
5 stars.xautopf: https://ptpb.pw/NMdR
Study.xautopf: https://ptpb.pw/hE7Q

Here are two that do not sort properly on synced devices:
4.5 stars.xautopf: https://ptpb.pw/lxOq
Harmonica.xautopf: https://ptpb.pw/a6ef

The properly syncing autoplaylists has a <DefinedSort Id="7" /> field whereas the other two improperly sorting autoplaylists do not despite the fact that the latter two have the same sorting scheme as the former two under "Album and Tracks > Sort By".  I guess MusicBee defaults to sorting by <Album> when the <DefinedSort Id=# /> field is missing when syncing to another device.  On the other hand, exporting any autoplaylist seems to export the list as displayed (WYSIWYG). 

I operated under the assumption that sorting was dictated by the custom view set for the autoplaylist.  The ones I posted here all have the same custom view "AT Study": https://ptpb.pw/BxiA

Correct me if I'm wrong, but I was surprised to find the custom view not containing any sorting data.  I figured that populating the affected autoplaylists with <DefinedSort Id=# /> would fix this issue and indeed it does.  My desired sorting scheme is A and I see it selected for the autoplaylist "4.5 stars".  However, 4.5 stars.xautopf is missing <DefinedSort Id="7" /> (and other fields), so switching sorting schemes back and forth under "Album and Tracks > Sort By" (A to B then back to A) populates the xautopf file with the necessary info.

Syncing before switching up the sorting scheme:
5/3/2016 10:47:12 AM - D:\Music\MusicBee\Playlists\Devices\Samsung Galaxy S5\4.5 stars.xautopf,enab=True,shuffle=None,sort=Ascending,export=False
5/3/2016 10:47:12 AM - Album:Ascending,

After switching up the sorting scheme:
5/3/2016 11:40:21 AM - D:\Music\MusicBee\Playlists\Devices\Samsung Galaxy S5\4.5 stars.xautopf,enab=True,shuffle=None,sort=Ascending,export=False
5/3/2016 11:40:21 AM - Artist:Ascending, Year (yyyy):Ascending, DateFilled:Ascending, Album:Ascending,

What happened was that I created these autoplaylists en masse and I settled on a custom view I liked.  After creating the playlist, I liked what I saw on screen and moved on to the next one without bothering to check if the xautopf contained fields for proper sorting, which seems to be crucial when syncing such playlists to external devices.

TL;DR version: When creating autoplaylists and selecting a custom view, the autoplaylist file (xautopf) does not contain a <DefinedSort Id="#" /> field (among other fields) despite the screen displaying the correct sort order and the correct sorting scheme selected under "Album and Tracks > Sort By".  Without these fields, MB defaults to <Album> sorting when syncing the playlist to another device.  A workaround is to select another sorting scheme and then go back to the originally selected scheme (A -> B -> A).

Moving forward, is it possible for MB to write sorting information in xautopf as displayed on screen following or upon creating autoplaylists?
Last Edit: May 03, 2016, 09:43:06 PM by ssri

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34312
thanks. the defined sort should be saved in the view as <SortOverride>5</SortOverride>
i think its just a bug with not using the custom view sort settings when a custom view is used and the playlist synched. I have made a change and testing it now


theta_wave

  • Sr. Member
  • ****
  • Posts: 680
Ah, I see now.  Yeah, my custom view had the sort override field and, like you stated, it appears syncing didn't read that field properly.  I just tested the latest build you posted and the following autoplaylist sorted correctly where it wouldn't have previously:

test.xautopf
Code
<?xml version="1.0" encoding="UTF-8"?>
<SmartPlaylist SaveStaticCopy="False" Layout="1" CustomSettingsName="AT_Study" LayoutGroupBy="0" ShuffleMode="None" ShuffleSameArtistWeight="0.5" MinimumArtistGap="0" GroupBy="track" ConsolidateAlbums="False" MusicLibraryPath="D:\Music\MusicBee\">
  <Source Type="1">
    <Description />
    <Conditions CombineMethod="All">
      <Condition Field="Custom1" Comparison="Contains" Value="Harmonica" />
    </Conditions>
    <Limit FilterDuplicates="False" Enabled="False" Count="25" Type="Items" SelectedBy="Random" />
    <SortBy Field="30" Order="Ascending" />
  </Source>
</SmartPlaylist>

Thanks Steven!