Author Topic: "On-the-fly-conversion" settings ignored with Sync_FileStart()  (Read 1543 times)

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34346
What displays in the sync window is inconsistent between Sync_FileStart and Sync_FileDeleteStart
eg)
MB doesnt have the tag attributes of the file being deleted from the device. However if you pass the filename of the file on the computer then i guess MB could try to get the details if the file still exists on the computer

BoringName

  • Full Member
  • ***
  • Posts: 209
MB doesnt have the tag attributes of the file being deleted from the device. However if you pass the filename of the file on the computer then i guess MB could try to get the details if the file still exists on the computer

The file still exists in MB, the user has just removed it from the sync list. If you are just syncing playlists and untick one of them, it will delete all the songs in that playlist off the device (if they are not in any other playlists and you have the delete setting enabled).

That being said, another scenario could be the song being deleted out of MB so it needs to be removed from the device, in that instance it would only have the filename to go off. Anyway, it's not really a big deal. It just stood out to me because the library I'm testing on is not organised at all so the filenames look a bit naff sometimes.

BoringName

  • Full Member
  • ***
  • Posts: 209
Any chance you can confirm PrepareSynchronise is working properly? I can't get it to do anything. I'm assigning lists to the update, deletes and playlist variables and popping up a message box so I know PrepareSynchronise is getting triggered and those variables have values after the Synchronise button is pushed. But the total files just changes with each track eg)
1 of 1
2 of 2
3 of 3
Instead of -
1 of 3
2 of 3
3 of 3

I assume it's setup so if it doesn't have any other info, it defaults the total track number to the current track number? Currently it seems to be ignoring what I am assigning to the PrepareSynchronisation variables, either that or I'm screwing it up which is a high probability...

With the code the way it is currently I probably won't be able to implement it properly anyway without a major rewrite but I have an idea for a workaround if I can get the thing to actually display something other than what I'm getting above.

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34346

BoringName

  • Full Member
  • ***
  • Posts: 209
I did 2 syncs using 2 playlists. The first playlist has 50 songs and the second has 1 song. First sync had both of them ticked, the second sync had the first playlist unticked. Delete files that are not on the auto-sync list from the device is ticked.

21/06/2022 6:27:50 PM - method settings=SyncRemoveMissingFiles,files=52,preview=False,conf delete=False
21/06/2022 6:27:51 PM - returned total=0,del=0
21/06/2022 6:31:11 PM - method settings=SyncRemoveMissingFiles,files=2,preview=False,conf delete=False
21/06/2022 6:31:12 PM - returned total=0,del=0

Thanks.

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34346
that means you are not adding any values to the: updates, deletes, playlists list parameters
you dont need to create new instances of those lists - just add to the appropriate parameter list

also i assume you accidentally left out:
PrepareSynchronise matched
from the error log right?

BoringName

  • Full Member
  • ***
  • Posts: 209
that means you are not adding any values to the: updates, deletes, playlists list parameters
you dont need to create new instances of those lists - just add to the appropriate parameter list

also i assume you accidentally left out:
PrepareSynchronise matched
from the error log right?

I thought you might say that after I looked at those zeroes in the log. Not surprised, forking this plugin is my first experience with C# and even beyond that I only have limited experience with javascript and php. I need to do a bit more reading to get my head around some of this stuff.

Yes I missed -
21/06/2022 6:27:19 PM - PrepareSynchronise matched

As I did 2 syncs and the last one only created 2 lines in the file, I just grabbed the last 4 lines thinking that's all the 2 syncs produced.... I should have paid more attention.


BoringName

  • Full Member
  • ***
  • Posts: 209
I've got this all implemented now, thanks for all the help.

I did come across an error but it's a bit obscure and maybe working as intended as it would only show up in certain scenarios.

If "delete files that are not on the auto-sync list from device" is unticked but the "confirm deletion" is ticked. Like in the picture below.


And the deletes variable in PrepareSynchronisation is populated, the sync will error with the following message

Length cannot be less than zero.Parameter name: length

The solution is to just tick the deletes option, untick the confirm box and then untick the deletes option again.

Normally you wouldn't populate the deletes variable if the delete files setting was unchecked, I only came across the error because I hadn't put in code to check that setting yet and I'm doing a bit of a workaround to calculate deletes at the moment instead of doing it properly.

Like i said, maybe it's working as intended and I doubt it will matter if you just leave it as is but I figured I would mention it in case it might be causing other errors somewhere.

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34346
for the next update, both parameters are tested so should fix this bug