Author Topic: Wifi android device synching  (Read 81478 times)

mgray

  • Newbie
  • *
  • Posts: 1
I agree with bkev. A way to directly use the stats.xml file would be ideal.

Steven

  • Administrator
  • Hero Member
  • *****
  • Posts: 32109
I dont have time to look at it for quite a while, but the source code is here:
https://github.com/mayallst/MusicBeeWifiSync
if anyone with java development skills can add support for reading the stats.xml file from an additional configurable location

foxgguy2001

  • Newbie
  • *
  • Posts: 1
I don't have any coding experience, but I have created an issue that outlines the Android 11 permission issue.  Hopefully someone can help!  
https://github.com/mayallst/MusicBeeWifiSync/issues/6

It appears permissions for MANAGE_EXTERNAL_STORAGE is needed
https://developer.android.com/training/data-storage/manage-all-files

However, looks like that may be difficult given restrictions on apps requesting these elevated permissions:
"You should request the MANAGE_EXTERNAL_STORAGE permission only when your app cannot effectively make use of the more privacy-friendly APIs, such as Storage Access Framework or the Media Store API. Additionally, the app's usage of the permission must fall within permitted uses, and must be directly tied to the core functionality of the app. If your app includes a use case that's similar to the following examples, it's likely to be allowed to request the MANAGE_EXTERNAL_STORAGE permission:

File managers
Backup and restore apps
Anti-virus apps
Document management apps
On-device file search
Disk and file encryption
Device-to-device data migration"

I don't think it'd be feasible to ask the Gonemad dev to save the backups to the shared media locations since that information is not media, and this would fall under the 'Device-to-device data migration' use case mentioned in the list above.  May just be as 'simple' as a little permissions tweak.  I put that in quotes only because I'm not sure what that entails...

thed0g195

  • Newbie
  • *
  • Posts: 3
Is it normal that the App keeps syncing same files over and over, despite they've just been synced already? Are there any file changes being done when you play music in musicbee and it registers that as a file change so it wants to sync it?

Or I'll ask like this: how does Musicbee Wifi Sync know which file was synced or not, or if there are changes?
Last Edit: June 08, 2021, 09:21:02 PM by thed0g195

frankz

  • Hero Member
  • *****
  • Posts: 2841
Is it normal that the App keeps syncing same files over and over, despite they've just been synced already? Are there any file changes being done when you play music in musicbee and it registers that as a file change so it wants to sync it?

Or I'll ask like this: how does Musicbee Wifi Sync know which file was synced or not, or if there are changes?

There are files in your MB AppData folder for each device.  One of these is a MBL file - MusicBee Library.  This keeps track of what's been put on the device and when the version on the device was updated.

Each time you change a file in any way - change a tag, add or edit artwork, add or edit lyrics,etc (even automatically if your settings do this)  - it updates the "Date Modified" date of the file in Windows.  MB compares the "Date Modified" of the file on your computer to the date of the version on the device.  If the "Date Modified" on your computer is more recent than the version on the device, the file will be resynched.
A smile is happiness you'll find right under your nose.

phred

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 6797
Excellent explanation, frankz.
Download the latest MusicBee v3.4 patch from here.
Unzip into your MusicBee directory and overwrite existing files.

----------
Check out the MusicBee Wiki.
How to post screenshots is here.

frankz

  • Hero Member
  • *****
  • Posts: 2841
Why thank you!
A smile is happiness you'll find right under your nose.

SkyZippr

  • Jr. Member
  • **
  • Posts: 111
Are there any file changes being done when you play music in musicbee and it registers that as a file change so it wants to sync it?
Play count and Last played are updated when you play it in MB. In my case, anything I play on my PC gets re-synced onto my Android.
And yes, since Play count and Last played are updated, Last modified is also updated in Windows.

frankz

  • Hero Member
  • *****
  • Posts: 2841
And yes, since Play count and Last played are updated, Last modified is also updated in Windows.
Unless you're specifically writing these to a tag, I don't see why this would be the case.  In general those are database fields, not tagged to the file.  Nothing I listened to today that wasn't updated in some other way has today as date modified either in MB or in Windows.

Auto-tagging ratings, lyrics, artwork - these things are generally the reason a file will get modified just from being played.
Last Edit: June 10, 2021, 02:17:50 AM by frankz
A smile is happiness you'll find right under your nose.

SkyZippr

  • Jr. Member
  • **
  • Posts: 111
Unless you're specifically writing these to a tag, I don't see why this would be the case.  In general those are database fields, not tagged to the file.
My bad. I must have altered something then, hopefully on purpose.

bkev

  • Newbie
  • *
  • Posts: 16
The guy that maintains GoneMad said this about the sync not working:

"The legacy storage option works up to and including android 11 as long as the app targets android 10. Once targeting 11 it stops working for Android 11+

It's a simple flag in the manifest and what gmmp currently is using for storage access"

Hopefully it seems like it can be fixed by someone that understand the current code and how to add in this flag.

christmw2503

  • Jr. Member
  • **
  • Posts: 33
Just need a clarification. Wifi sync doesn't work if my PC is connected to my phone's wifi hotspot? Because sharing my phone internet to my PC, I get the error "Server Not Found". But if I connect both PC and phone to the same router, the sync works fine.

phred

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 6797
That's correct.

The PC with MB, and the portable device with the MB Sync App have to be on the same (WiFi) network.  Connecting to a hot spot is not the same as being on your own network.
Download the latest MusicBee v3.4 patch from here.
Unzip into your MusicBee directory and overwrite existing files.

----------
Check out the MusicBee Wiki.
How to post screenshots is here.

christmw2503

  • Jr. Member
  • **
  • Posts: 33
Something must've changed. Earlier when the app launched, syncing with mobile Hotspot worked. I used it multiple times, even when mobile data was off on the phone. I think it was using Wi-Fi direct protocol.

phred

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 6797
Something must've changed. Earlier when the app launched, syncing with mobile Hotspot worked. I used it multiple times, even when mobile data was off on the phone. I think it was using Wi-Fi direct protocol.
From the very first post in the thread:
Instructions:
- only connections from your private network are supported

Hotspots are not part of your local (private) network.
Download the latest MusicBee v3.4 patch from here.
Unzip into your MusicBee directory and overwrite existing files.

----------
Check out the MusicBee Wiki.
How to post screenshots is here.