Author Topic: Storage API are not working at all for MB 3.0  (Read 8109 times)

boroda

  • Sr. Member
  • ****
  • Posts: 4626
subj. more exactly mb 3.0.6014, but i remember some plugin developer complained about this several weeks or months ago. i thought that he did something wrong, but now i've found that my new plugin (not released yet) doesn't work at all and 2 my old plugins which are using storage api don't work also.

nothing is displayed under plugin node (except for empty 'music' category for 1 plugin, but nothing at all for another), sync dialog shows correct number of files and total file size, but clicking on 'preview' button just display empty list of tracks.

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34363
which plugins are you refering to?
i know you did a google play plugin but i thought that it was no longer working because of changes made by google
So which plugin of yours could i run myself.
Also it might help if you sent me the source code (if you are happy to do that)

boroda

  • Sr. Member
  • ****
  • Posts: 4626
try latest uploaded version of 'ipod driver' plugin (you will need to install itunes to make this plugin to work, but you don't need to have ipod/iphone, plugin can work in 'offline' mode):

http://www.mediafire.com/download/ces3zp9ygmqs4x9/mb_iPod%26iPhoneDriver-2014-06-28.zip

if you need that i can upload my new plugin which uses storage api, its much-much simpler, but its only a beta (maybe even alpha).

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34363
I just tried using the version from the zip you linked to and all is working fine. I can see the iTunes library and all the playlists. I am using iTunes 12.4 if that makes any difference.
I didnt change the API functionality for v3, so it should work the same as v2.5 but i accept there can be unexpected side-effects that might cause issues.
Does it still work using MB v2.5 on your computer?
If your new plugin doesnt work, then i would need to know which API method you are calling that doesnt give the expected result

boroda

  • Sr. Member
  • ****
  • Posts: 4626
i'll try to dig a bit more deeper into it as i had a comp crash recently and some files are damaged now. will report back later if find more useful for you info.

btw. have you tried to preview sync? does it work, displays list of tracks to be synced?
Last Edit: June 22, 2016, 06:28:19 AM by boroda74

boroda

  • Sr. Member
  • ****
  • Posts: 4626
actually i've improperly setup itunes for using with ipod plugin. the strange thing is that syncing preview shows empty track list. is this intensional?

for the new plugin i'm getting this text in error log just after i click on triangle to expand plugin node:

22.06.2016 15:20:26 - startIndex ?? ????? ???? ??????, ??? ????? ??????.
??? ?????????: startIndex
22.06.2016 15:20:26 - 10.0.10586.0 - 3.0.6016.36970 - System.ArgumentOutOfRangeException: startIndex ?? ????? ???? ??????, ??? ????? ??????.
??? ?????????: startIndex
   ? System.String.Substring(Int32 startIndex, Int32 length)
   ? #=qdGQm_ZEb4mpOuEVCqeAi1YxaognX8arcUV1haHK5AmM=.#=qozKipdbUq8YcywRV_ONHbQ==(#=qypC8rDmbZ2vgwQ0skGDnFEDidpGXq2QbTWGelHWDaB4= #=q8_HAdYn_spjWVXqMtAoP$w==)
   ? #=qdGQm_ZEb4mpOuEVCqeAi1YxaognX8arcUV1haHK5AmM=.#=qLJr6$fp2B_4YMfvphcixFQ==(#=qypC8rDmbZ2vgwQ0skGDnFEDidpGXq2QbTWGelHWDaB4= #=qtJ3Pcz1H6S5AlWEC7aWrng==)
   ? #=qhyaYNqEtMo2ZfpqkOVs02V8M4rs0gx4laRRl0BcgzOA=.#=qM8vtof9b8CiUKxmKYjfWHw==(Boolean #=qrEl$Dlo7kP5xT1_cTu8xaf9_0hnsZPZiRn$lbhmWj$0=)
   ? #=qRJWAd7kBwQ1oCUXObZCNLjdEngm1XFK_wQeVr$HHQ8g=.#=qEDlUpSnr58QZS$yiNAzayQSf4MdMndAGacCgxM9xQOE=(#=qJIWvHa1HqgXRBOi87DKnFQ== #=q44LlHe$U98yfzYNmIf4sKg==, Boolean #=qzBParpMz5Fq3vSh421g7Uk78B40dwR5MmVZlWRGtBn8=)




obviously plugin passes either null or empty string to mb, but i can't understand what exactly string is wrong.

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34363
the error is because MB is trying to parse the string as a folder path but the string is blank ie. the url for one or more of the results returned from the plugin contain a blank path

boroda

  • Sr. Member
  • ****
  • Posts: 4626
still cant find a code which returns empty string as file path to mb. Steven, could you make a debug version of mb? i would want as much info about this error as possible, but at least which virtual device method raises the exception.

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34363
i can see what the issue probably is:
does your virtual storage have folders? (the iTunes one doesnt)
            // device supports a folder structure and allows the user to specify a naming template for the files
            public bool OrganisedFoldersSupported;

if set to true then there is a bug on the MB side when MB first calls StorageGetFolders(path) method
I have fixed that for the next patch update

boroda

  • Sr. Member
  • ****
  • Posts: 4626
i can see what the issue probably is:
does your virtual storage have folders? (the iTunes one doesnt)
YES! and its my 1st storage api plugin which uses organized folders.

if set to true then there is a bug on the MB side when MB first calls StorageGetFolders(path) method
I have fixed that for the next patch update
thanks!


boroda

  • Sr. Member
  • ****
  • Posts: 4626
Code
        public static bool Synchronise(Plugin.SynchronisationSettings flags, KeyValuePair<int, string[]>[] files)
        {
            // flags has bit indicators whether 2 way rating and/or playcount is requested (only set if enabled in the device properties)
            // for files():
            //   Key - the SynchronisationCategory the file should be sychronised to if appropriate for the device
            //   Value is 3 strings
            //   (0) - source file or playlist to be synchronised - use to query MusicBee for file tags, or files in a playlist
            //   (1) - the filename extension of the file to be synchronised - normally the same as the extension for (0) but if the file would need to be re-encoded to meet the user's synch preferences then the extension for the encoded file
            //   (2) - if SyncOrganisedFolders is enabled, filename as formatted by a naming template otherwise null
            // for each file that is synchronised, call Sync_FileStart(filename(0))
            //   MusicBee will determine if the file needs to be re-encoded depending on the user synch settings and if so the returned filename will be the temporary encoded filename
            //   call Sync_FileEnd(filename(0), success, errorMessage) when that file has been synched or not
            // return true if all files synchronised ok


Steven, i'm getting only nulls in Value(2). Could you check this (i'm using organized folders, in my previous plugins nulls in Value(2) were expected)?

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34363
i dont really remember the reasons but the third parameter is always null and i made no attempt in the code to set it. Are you asking just to check you havent done something wrong or is there a reason you need this value?

boroda

  • Sr. Member
  • ****
  • Posts: 4626
my new plugin 'sync links' creates a hard links/symbolic links to the original library files. then synced folder can uploaded to unrooted android device via 3d party apps. it would be very convenient to have different subfolders for music/playlists/videos, etc. also it would be useful to use generic mb device ui to set up naming templates for media files. i don't see any potential bugs with generation destination file paths (of course, relative to virtual device root). if its not needed for plugin, then plugin can just not use Value(2) parameter.

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34363
i can probably do this but firstly can you confirm MB is allowing you to enter a naming template on the device synch settings dialog?