getmusicbee.com

MusicBee & Add-Ons => Customizations => Plugins => Topic started by: boroda on June 30, 2016, 04:56:34 PM

Title: Sync Links
Post by: boroda on June 30, 2016, 04:56:34 PM
Is a well known issue that you can't get file access to unrooted Android devices via WiFi and hence can't sync MusicBee with Android devices via WiFi. One possible solution is to setup a local PC folder as virtual device in MusicBee, sync MusicBee with that 'device', then you can use 3d party apps (e.g. 'Resilio Sync' (recommended) or 'Cheetah Sync') to sync PC folder with Android folder via WiFi. But this has one disadvantage: all synced files will be duplicated on PC. This plugin may help in this situation. It will create own virtual device 'Sync Links' in MusicBee and will create hard links or symbolic links to original library media files in some folder on syncing. Hard links/symbolic links occupy very little space on HDD (though Windows Explorer will show the sizes of original files, not the actual sizes of links).

SOME NOTES:

Download (https://getmusicbee.com/addons/plugins/46/sync-links/)

Provide feedback on this topic.
Title: Re: Sync Links
Post by: /lasse on August 26, 2016, 11:28:21 PM
I will try it. Had just set up the virtual device stuff and installed Cheetah Sync.
I was forced to use wifi when the USB port on my LG G2 got faulty and only charged.
Cheetah Sync (made by those who make iSyncr) seems to work well, and no need to root.
Title: Re: Sync Links
Post by: psychoadept on August 26, 2016, 11:37:51 PM
I personally recommend BitTorrent sync over cheetah sync.  You just have to pay attention and make sure you're setting it to sync over LAN only.  But it's much faster and seems to run better on both systems.
Title: Re: Sync Links
Post by: /lasse on August 27, 2016, 12:02:42 PM
Well I have to try the BitTorrent sync to.
Does it sync one-way, two-way and delete and so on?

Didn’t manage to make the mb_SyncLinks work, did install but  when try to sync an “aborted” window came up. And then couldn’t change mb_SyncLinks settings, kind of links to create.
MusicBee 3.0.5995

Is it supposed to make conversions (flac to mp3) on the fly? Or is the only alternative to save converted files?
Title: Re: Sync Links
Post by: boroda on September 02, 2016, 07:56:15 AM
Didn’t manage to make the mb_SyncLinks work, did install but  when try to sync an “aborted” window came up. And then couldn’t change mb_SyncLinks settings, kind of links to create.
MusicBee 3.0.5995

3.0.5995 is not supported. try *latest* mb patch.

Is it supposed to make conversions (flac to mp3) on the fly? Or is the only alternative to save converted files?
yes.
Title: Re: Sync Links
Post by: musicbee2016 on November 13, 2016, 03:56:53 PM
Hello,

Thanks for this plugin, it is exactly what I was hoping would exist, unfortunately I'm having issues similar to the user above.

I am able to select "Create hard links" and "Create symbolic links" but neither setting will save. Only "Create links to original files..." or "Copy temp..." will save.

I've tried everything I could think of including directly editing with settings .xml file, but when send a file to the Sync Links device in MusicBee, it will copy the file to the destination, not create a link. The copy is on the same NTFS volume as the source file.
 
I've also tried running MusicBee as admin. I'd love to use this plugin, any help appreciated.

I'm running:

Windows 10 x64
MusicBee 3.0.6132 (also tried 6032)
SyncLink 4.1.6025
Title: Re: Sync Links
Post by: boroda on November 13, 2016, 04:35:36 PM
http://www.mediafire.com/file/vya69m1421mmmav/mb_SyncLinks_2016-11-13.zip

source:

http://www.mediafire.com/file/95vwdfxrg5k1622/Sync_Links_2016-11-13_19.33.10.rar
Title: Re: Sync Links
Post by: musicbee2016 on November 13, 2016, 05:04:28 PM
You're a champion. Thanks!

New version verified working, I did need to run MusicBee with admin in order for the plugin to be able to create links.

Windows 10 x64
MusicBee 3.0.6132

Title: Re: Sync Links
Post by: boroda on November 13, 2016, 08:03:01 PM
I did need to run MusicBee with admin in order for the plugin to be able to create links.
yes, i haven't thought about it.
Title: Re: Sync Links
Post by: gaberad on February 24, 2017, 04:03:03 AM
I was trying this out and ran into an error (unless there's some setting or something I've missed):

When you sync 'all playlists' or 'selected playlists only' the .mpb playlist file is included in the list of files to be synced, but the part in the code where it tries to set the syncedTrackFilename is trying to use a value that is null, causing it to throw an 'object not set to an instance of an object' exception.

(http://i.imgur.com/06SHONw.png)

(http://i.imgur.com/Kaib1jL.png)


What I did was just filtered out any item that had a null Value[2] (had to add "using System.Linq;").

(http://i.imgur.com/7nqfQvy.png)



For the admin/symbolic link issue, you can try to add your user account permission to create symbolic links:
http://superuser.com/questions/124679/how-do-i-create-a-link-in-windows-7-home-premium-as-a-regular-user

It doesn't work for me though, because it looks like if your account is part of the administratos group (which mine is) then it won't work:
http://stackoverflow.com/questions/29063916/win32api-symlink-creation-issue-with-uac-enabled
http://superuser.com/questions/104845/permission-to-make-symbolic-links-in-windows-7

"Note that this setting has no effect on user accounts that belong to the Administrators group. Those users will always have to run mklink in an elevated environment (as Administrator)."


So I did some testing and made it so the plugin creates are list of mklink commands, then runs the list in an elevated command process (which will invoke a UAC prompt). It works for me. I supposed you could also write out the commands to a batch file and run the batch file too.
http://stackoverflow.com/questions/13807429/running-cmd-commands-with-administrator-rights

(http://i.imgur.com/SSG2tvj.png)

(http://i.imgur.com/7h1dtoa.png)

(http://i.imgur.com/JIrc0QE.png)

(http://i.imgur.com/ure4PMg.png)
Title: Re: Sync Links
Post by: boroda on February 25, 2017, 03:06:08 PM
@gaberad

WOW! Thanks a LOT. Will modify plugin according to your advices.
Title: Re: Sync Links
Post by: boroda on February 26, 2017, 02:20:53 PM
new plugin version:

http://www.mediafire.com/file/e8hm73d3cm3v4ik/mb_SyncLinks_2017-02-26.zip

source:

http://www.mediafire.com/file/zdibmnl9s5o0a9c/Sync_Links_2017-02-26.rar

---------------------------

now right are auto-elevated for creation of symbolic links.
Title: Re: Sync Links
Post by: Space Octopus on June 05, 2017, 08:41:23 PM
Doesn't seem to be working for me, even run as admin & with the most current versions of both Musicbee & the plugin.
For some reason it did let me copy over 2 files, then failed with "object reference not set to an instance of an object". That was drag and drop.
When trying to sync through sync settings, it just aborts the sync no matter what I do.
I tried every different selection in the settings. Same result.

Just got this error, too:
Code
MusicBee v3.1.6345.38589 (Win6.1), 5 Jun 2017 12:49:

System.NullReferenceException: Object reference not set to an instance of an object.
   at MusicBee.Media.Storage.#=q5fs6fKGbCbPVIcXzmBHgcdgPORYbSRW1P5FVGK10fTqJrJVT6gGmqX4Yd9SszOyJ(#=qYCOlrFQ5d9XNKhepbbIIpaFQxY6tOq2L0agf_Gr_zHs= #=qP9diMp46GkwqbjFCG7EpJw==, #=qsucckV1WERnrrP$BQTZe88kc5fzVTl8B5jdbSCs5M6M= #=q9TXDktxtLVKZZW2gg5WgpQ==, String #=qR4nBg5zgTXveOdFyV8JZ6w==, Int32 #=qSXL5U2D5_DOSUbIOOJ1f1A==)
   at MusicBee.Media.Storage.#=qO8LTIvn8sxiIlyYrKiaWEw==(#=qYCOlrFQ5d9XNKhepbbIIpaFQxY6tOq2L0agf_Gr_zHs= #=qfrqndb4sEqfIeaidxU7SUw==, Int32 #=qGxBlZfThFJ_NoJjAeXT86qVyBz8lvX2pgrYyuaSmG5Q=)
   at #=q156AcxeJqRZfdwEcnxPXDQAK9CVra7xeAaqUivLVtcg=.#=q1JfSI6qYjrVpl$ZE7ZWIvw==(Boolean #=qM1QHccsiqtA6Rm4dkWXObg==, Boolean #=qHC2PizOYeDTcKwSgmWsi6Q==, Dictionary`2 #=qfJ2uQqRN6O$zm0pKO$RTgwLLAvjpF25hEmrvuuvpAAM=, List`1 #=qy6uRFFEyhg1fIR2NKNl8_wpReHjP2MmKHo1ZF1mACz0=, Object #=q8w97IrUTuAD4v$$bBwrbWR3Yc8F1h1chOQQy6Kv_Vnw=)
   at #=q156AcxeJqRZfdwEcnxPXDQAK9CVra7xeAaqUivLVtcg=.#=qshik6hyIhLlqES_jHcqbrA==(IList`1 #=qBW4QfImybZ8ZLWl04doc3Q==, Object #=qVwYL$lrjc_TMrZs6Fqk5aQdRKJb7EitiYdwOC1bAcrI=)
   at #=q_DkWgVwMw6cfu8QKnVn5vAnW2tlzd$qGQzinCN9X5gY=.#=qI$XEEiFG7AlkAbXI8opAw1iSBYRnIZgnL$MKmm9WsXk=(Object #=qJiJ79fhkxZpJR2p4eeTxyg==)
Title: Re: Sync Links
Post by: Space Octopus on June 05, 2017, 08:52:45 PM
I also sometimes get an aborted window, at the bottom it says "an entry with the same key already exists"
Title: Re: Sync Links
Post by: Steven on June 05, 2017, 09:03:13 PM
try with the latest patch version:
http://musicbee.niblseed.com/V3_1/MusicBee31_Patched.zip
unzip and replace the existing files where MB is installed
Title: Re: Sync Links
Post by: boroda on June 05, 2017, 09:23:20 PM
please report back your results after upgrading mb as if its plugin bug i want to fix it.
Title: Re: Sync Links
Post by: Space Octopus on June 05, 2017, 09:32:22 PM
Unfortunately I still get the errors & aborted window with the patch :( Sorry.
Title: Re: Sync Links
Post by: Space Octopus on June 05, 2017, 09:33:35 PM
I will help in whatever way I possibly can, to get this fixed.
Oh, btw, I'm using portable Musicbee, could that have an impact?
Title: Re: Sync Links
Post by: boroda on June 06, 2017, 10:47:40 AM
no, the only difference between portable and regular mb is where mb stores its service data: either in folder <musicbee application folder>\appdata or in folder <appdata>\musicbee. i'll now reread your bug report and maybe prepare debug plugin version.
Title: Re: Sync Links
Post by: boroda on June 07, 2017, 08:38:45 AM
@Space Octopus

Steven has found out why this error happens, try mb latest patch:

http://musicbee.niblseed.com/V3_1/MusicBee31_Patched.zip
Title: Re: Sync Links
Post by: Space Octopus on June 09, 2017, 06:20:11 AM
He already told me to do that. I had tried it, but I tried again just now for kicks, and still have the problem.
It just says "synchronization not completed" at the bottom of Music Bee, and the window that popped up says "aborted" at the top. I'm stumped.

What's ultra weird is if I try to do it as soon as I open MusicBee (immediately), it works for a few seconds, and some of the links get made, but then it eventually stops working pretty quick.
Title: Re: Sync Links
Post by: boroda on June 09, 2017, 06:45:32 AM
check error log (help> support> error log) at the bottom of file to see if it contains any info about syncing.
Title: Re: Sync Links
Post by: Steven on June 09, 2017, 07:09:17 AM
He already told me to do that. I had tried it, but I tried again just now for kicks, and still have the problem.
i made a further change after that so you need to redownload it
Title: Re: Sync Links
Post by: Space Octopus on June 10, 2017, 02:06:06 AM
I did mention that I tried it again after boroda said to. It still doesn't work. Unless you mean after that, even.
I will try again, but I believe it's the same one.

P.S. I did check error log. There seems to actually be nothing about the plugin. The only errors I have are from other stuff, a few days ago.
Title: Re: Sync Links
Post by: Space Octopus on June 10, 2017, 02:23:11 AM
Yeah, just like before, neither the patch or the most recent version of the plugin are fixing this for me. :/
(http://i.imgur.com/IY3DJh3.png)
Title: Re: Sync Links
Post by: boroda on June 10, 2017, 09:50:04 AM
*this* error seems to to be a plugin bug. i'll try to check this.
Title: Re: Sync Links
Post by: Gkkiux on February 18, 2019, 09:28:34 PM
Hi,

So I got the same error and wanted to figure out what's going on. After an evening of learning to debug dlls I came across an error in
Code
syncedFiles.Add(syncedTrackFilename, 0);
Apparently the file list has duplicates, which makes that line fail dramatically. Seemed like an easy enough fix, but now this ends up null when syncing playlists:
Code
string reencodedFileName = Plugin.MbApiInterface.Sync_FileStart(filename)
Any idea what's going on here?
Title: Re: Sync Links
Post by: zkhcohen on February 24, 2019, 04:53:16 PM
Hi,

So I got the same error and wanted to figure out what's going on. After an evening of learning to debug dlls I came across an error in
Code
syncedFiles.Add(syncedTrackFilename, 0);
Apparently the file list has duplicates, which makes that line fail dramatically. Seemed like an easy enough fix, but now this ends up null when syncing playlists:
Code
string reencodedFileName = Plugin.MbApiInterface.Sync_FileStart(filename)
Any idea what's going on here?

Hey. I don't know if this works for your specific use-case, but there's currently a new, improved wifi sync app in beta. If you're interested, follow the topic below:

https://getmusicbee.com/forum/index.php?topic=27681.new;topicseen#new
Title: Re: Sync Links
Post by: Gkkiux on February 27, 2019, 08:45:42 PM
Thanks, looks like there's now a new thread to follow. It would be nice to fix this plugin just for the sake of it though
Title: Re: Sync Links
Post by: boroda on July 04, 2022, 10:53:39 PM
new plugin version released:

https://www.mediafire.com/file/0lwi8gfrax8uoo9/mb_SyncLinks_latest.zip/file

various bugfixes.

go to "edit> preferences> plugins> sync links"  (or "Tools> Sync Links Settings", which is the same thing) after installing/updating plugin, some sync settings are moved there from sync links device properties. If you have decided to use Resilio Sync (https://www.resilio.com/individuals/) in conjunction with Sync Links for syncing with Android, it's recommended to disable "Selective Sync" and "Preferences> Use archive" options, and enable "Preferences> Overwrite changed files" option for Sync Links folder on Android.

it's recommended to update mb to latest patch:

https://getmusicbee.com/patches/MusicBee35_Patched.zip
Title: Re: Sync Links
Post by: MasterP on July 23, 2022, 10:18:12 PM
@boroda I'm just wondering what would be the outcome if i set up file on-the-fly file conversion in device settings for a sync links device using hard links. Would it alter the original file, would it just do nothing or how would it work? I remember a previous version had settings for temporary converted files but never figured that out. And now I don't see those anymore in sync links settings.

Thank you for your work. I use this plugin to sync music to android via Syncthing,
Title: Re: Sync Links
Post by: boroda on July 24, 2022, 07:43:08 AM
plugin will copy converted files to the destination folder instead of creating links, if you choose to convert files. now converting files makes sense only for file formats unsupported by destination device (this can be set up in sync link device properties). i've removed the option to create links in any case (this option served to force creating links if conversion caused by embedding artworks only), because syncing time was the same with this option on and off. for now, adjust artwork settings in sync links device properties.
Title: Re: Sync Links
Post by: MasterP on July 25, 2022, 02:31:46 PM
Thanks for the explanation. I mostly need conversion for volume normalization though, since no android player seems to care for replaygain tags...