Android sync with mediamonkey

This forum is for questions / discussions regarding development of addons / tweaks for MediaMonkey for Windows 4.

Moderators: Gurus, Addon Administrators

zombiefly
Posts: 190
Joined: Fri Jun 08, 2007 3:33 pm

Android sync with mediamonkey

Post by zombiefly »

Hi,
I've posted a few things over the years about android device sync with mediamonkey. Well... i think I may well be on the cusp of a complete playcount/skip count/auto playlist function!

What I want:
I want to be able to sync my android device with MM, but also retrieve information back from the device re: playcount, skips etc. This information can then be put back into the MM db and Autorate accurate can take this info into account when rating. I can then use playlists to resync based on the rating applied by autorate accurate.

What I can't have and why:
I cant have the bit that collects data on the phone and moves this back to MM (skip count etc). I can however collect the data from lastfm and bring that back to MM, which when used with a scrobbler that only scrobbles after 50% of the track is played, sort of allows me to influence the results of Autorate Accurate. There is currently no way of collecting this data from the android device as no players support such a bespoke development.

What i've now got:
I have modified a lastfm sync script (found on this forum) so that it collects the last 10 pages of my history and directly updates the play count of the scrobbled tracks. This works well, and after sync I can see my MM matches lastfm history. I use a scrobbler on the phone that only scrobbles (read: logs the play) if over 50% is played. I can't record skip count on the phone, nor can I flag for deletion.

What I plan to do:
I'm working with the developer of the MusicMod player (based on stock) for android. He is producing me a version that will create a log file of track played, skip count, flag for delete etc. This is the missing bit as far as i'm concerned. Once I have this information, I plan on importing this during the sync process in MM, deciphering the content and adding it into the MM db. After this process, i'm hoping I will be able to replicate the "play" on the mobile device exactly as if it had been played in MM.

for this to work in a sensible fashion I need some help from those of you who know MM development. If you could please post your comments/opinions on the idea as a whole and the following points:

1. I would like to have MM "pick up" the log file from the phone during sync. I'm not sure how this would/could work in the current sync environment of MM. Could the existing process be adjusted via script?
2. Once I pick up the file, I think there's enough in the last.fm script for me to rework some updates to post the data back into the db. Is there an internal skip counter in MM or is that something that's unique to the Autorate Accurate script? If this is the latter, I think i need to adjust the custom field ARA uses for storing its ratings. Does anyone have any ideas on this?

If anyone would like to help develop this then I think this could be the missing link between MM & Android....

comments please? :)
MM5 latest [Gold] / MMA latest | OnePlus 8 PRO | Noise I make: Pushkin on Soundcloud
Image
zombiefly
Posts: 190
Joined: Fri Jun 08, 2007 3:33 pm

Re: Android sync with mediamonkey

Post by zombiefly »

Why does it take so long to get a response on these forums? Once this was a vibrant place full of activity, seems nothing is happening with MM development any more???

Is MM dying? i certainly hope not as it's the only thing that works to my requirements..... :(
MM5 latest [Gold] / MMA latest | OnePlus 8 PRO | Noise I make: Pushkin on Soundcloud
Image
trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK
Contact:

Re: Android sync with mediamonkey

Post by trixmoto »

You only waited 11 hours - it's an international forum and therefore some people will have been sleeping!

1) I don't think "during sync" is possible currently.

2) The auto-rate script uses the fact that the ratings have boundaries to store the skip count within the ratings field (or at least it used to last time I checked it out). From MM4 there will be a proper SkipCount property you can use.

Final comment... patience is a virtue. :lol:
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
zombiefly
Posts: 190
Joined: Fri Jun 08, 2007 3:33 pm

Re: Android sync with mediamonkey

Post by zombiefly »

trixmoto wrote:You only waited 11 hours - it's an international forum and therefore some people will have been sleeping!

1) I don't think "during sync" is possible currently.

2) The auto-rate script uses the fact that the ratings have boundaries to store the skip count within the ratings field (or at least it used to last time I checked it out). From MM4 there will be a proper SkipCount property you can use.

Final comment... patience is a virtue. :lol:
thanks for your input! :) sorry i'm impatient ... i've been waiting years to do this and it's all coming together! (well, with string and tape!) since I managed to get an android dev to listen to my ramblings! :)

So for now i'd need to have an "out of process" script to retrieve the log file and process it into the db.... Is there an easy way of getting the root folder of a sync'd player from MM's internals? So the script would know where to look on the device? I know I could look at a drive location but that doesn't really integrate with MM.

Sorry i'm new to MM programming but I am a programmer so I just need a few pointers (maybe some existing scripts I could reference that do similar things)

how long until MM 4? ;)
MM5 latest [Gold] / MMA latest | OnePlus 8 PRO | Noise I make: Pushkin on Soundcloud
Image
trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK
Contact:

Re: Android sync with mediamonkey

Post by trixmoto »

I've not really done much work with synching as it's always done everything I've needed it to. There is however a "SynchLocation" table in the database that you might be able to use to work out the root.

The alphas for MM4 should be appearing "soon" but they're still working to stablise the new functionality before they release it into the wild.
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
zombiefly
Posts: 190
Joined: Fri Jun 08, 2007 3:33 pm

Re: Android sync with mediamonkey

Post by zombiefly »

thanks for the reply! I'll have to read up on setup of a dev environment so I can poke around in the database.
Looking fwd to MM4! :)
MM5 latest [Gold] / MMA latest | OnePlus 8 PRO | Noise I make: Pushkin on Soundcloud
Image
markstuartwalker
Posts: 931
Joined: Fri Jul 10, 2009 8:10 am

Re: Android sync with mediamonkey

Post by markstuartwalker »

I've created a full MM device plugin for iTunes so I have the recovery of playcounts etc already understood.

Are you programming in VB or Delphi?
Windows 7,8 / Ubuntu 13.10 / Mavericks 10.9 / iOS 7.1 / iTunes 11.1
iTunes plugin (d_itunes & itunes4) http://www.mediamonkey.com/forum/viewto ... =2&t=45713
Running MM under Mac OS X with Wine http://www.mediamonkey.com/forum/viewto ... =4&t=58507
zombiefly
Posts: 190
Joined: Fri Jun 08, 2007 3:33 pm

Re: Android sync with mediamonkey

Post by zombiefly »

markstuartwalker wrote:I've created a full MM device plugin for iTunes so I have the recovery of playcounts etc already understood.

Are you programming in VB or Delphi?
ooh excellent!... I will be using VB. :D
MM5 latest [Gold] / MMA latest | OnePlus 8 PRO | Noise I make: Pushkin on Soundcloud
Image
markstuartwalker
Posts: 931
Joined: Fri Jul 10, 2009 8:10 am

Re: Android sync with mediamonkey

Post by markstuartwalker »

Unfortunatly the device plugin so far have been written in Delphi. Any COM capable language will do but you'll have to translate the API methods into VB.

Also the VB must be compiled into a dll. VB script is not enough.
Windows 7,8 / Ubuntu 13.10 / Mavericks 10.9 / iOS 7.1 / iTunes 11.1
iTunes plugin (d_itunes & itunes4) http://www.mediamonkey.com/forum/viewto ... =2&t=45713
Running MM under Mac OS X with Wine http://www.mediamonkey.com/forum/viewto ... =4&t=58507
zombiefly
Posts: 190
Joined: Fri Jun 08, 2007 3:33 pm

Re: Android sync with mediamonkey

Post by zombiefly »

how do you think my version should work (without itunes)?
I'm still trying to pull a rough design together in my head... Would collecting the play information from android (via a log file) be the way to go?
From what I understand so far if I could log the plays and skips on the phone itself then pick up this file, i could then process these into the MM database? via a script? where would this script need to be? would it need to be a manual script execution or could it be wrapped in the sync process?
MM5 latest [Gold] / MMA latest | OnePlus 8 PRO | Noise I make: Pushkin on Soundcloud
Image
markstuartwalker
Posts: 931
Joined: Fri Jul 10, 2009 8:10 am

Re: Android sync with mediamonkey

Post by markstuartwalker »

Once you get the raw information of what is played and when then the process is pretty simple. Correlation of the actual tracks can be simply by title but that fails with renamings so you might like to think of something else.

What about rating synchronisation?
Windows 7,8 / Ubuntu 13.10 / Mavericks 10.9 / iOS 7.1 / iTunes 11.1
iTunes plugin (d_itunes & itunes4) http://www.mediamonkey.com/forum/viewto ... =2&t=45713
Running MM under Mac OS X with Wine http://www.mediamonkey.com/forum/viewto ... =4&t=58507
zombiefly
Posts: 190
Joined: Fri Jun 08, 2007 3:33 pm

Re: Android sync with mediamonkey

Post by zombiefly »

i'm using autorate script to build the ratings. I was thinking of letting that work them out as if the tracks were played in MM.
MM5 latest [Gold] / MMA latest | OnePlus 8 PRO | Noise I make: Pushkin on Soundcloud
Image
markstuartwalker
Posts: 931
Joined: Fri Jul 10, 2009 8:10 am

Re: Android sync with mediamonkey

Post by markstuartwalker »

How does the Android appear to windows? By drive letter? If so it would be very easy to read and process a file from a drive letter and process the playcount information.

Could you draft out the formation of such a file? I'm guessing that it could simply be a track ID reference followed by the time and date that it was played on...

Code: Select all

00123 10:14 19/04/2010
04132 10:17 19/04/2010
92311 10:20 19/04/2010
04527 10:30 19/04/2010
00442 10:33 19/04/2010
00013 10:35 19/04/2010
Windows 7,8 / Ubuntu 13.10 / Mavericks 10.9 / iOS 7.1 / iTunes 11.1
iTunes plugin (d_itunes & itunes4) http://www.mediamonkey.com/forum/viewto ... =2&t=45713
Running MM under Mac OS X with Wine http://www.mediamonkey.com/forum/viewto ... =4&t=58507
zombiefly
Posts: 190
Joined: Fri Jun 08, 2007 3:33 pm

Re: Android sync with mediamonkey

Post by zombiefly »

markstuartwalker wrote:How does the Android appear to windows? By drive letter? If so it would be very easy to read and process a file from a drive letter and process the playcount information.

Could you draft out the formation of such a file? I'm guessing that it could simply be a track ID reference followed by the time and date that it was played on...

Code: Select all

00123 10:14 19/04/2010
04132 10:17 19/04/2010
92311 10:20 19/04/2010
04527 10:30 19/04/2010
00442 10:33 19/04/2010
00013 10:35 19/04/2010
yes it uses the generic usb dll to sync the device, so grabbing the file from the file system would be the easy bit. It's getting it into the sync process that's the problem. If the file was put into the root of the sync folder, the player app would need to know it's location (configurable option?) so that it could log the plays.

The file structure you posted would be something like that yes, but would hopefully include a skip count (possibly to use in autorate script custom field? or MM4's forthcoming internal field). Maybe rating too, but that would require an android app that supported a rating.
MM5 latest [Gold] / MMA latest | OnePlus 8 PRO | Noise I make: Pushkin on Soundcloud
Image
zombiefly
Posts: 190
Joined: Fri Jun 08, 2007 3:33 pm

Re: Android sync with mediamonkey

Post by zombiefly »

Ok. I'm back again. I did attempt to start the ball rolling on with full android sync a while ago, contacted player pro (android) dev, contacted MM devs, connected them together and .... i'm not sure what happened next :)

..so, revisited this today. I noticed that playerpro can now output an xml stat report of played tracks, ratings, skips etc. Looking at the export info, this is ideal for importing into MM.

I'm using a modified version of LastFMImport.vbs, i'm having trouble remembering who wrote the original script! (help!)

What I want to do is modify the lastfm script, pass it the export from playerpro and adjust the script to use that rather than last.fm's xml.

The same logic will apply, the script will loop through the play history and update the MM database with playcount, skip etc.

The PlayerPro stats export looks like this:
<mediaitem>
<last-played>1297172931120</last-played>
<artist>A Guy Called Gerald</artist>
<track>People Moover</track>
<album>Tronic Jazz: The Berlin Sessio</album>
<duration/>
<rating>5</rating>
<play-count>1</play-count>
<skip-count>1</skip-count>
</mediaitem>

The problem is, i simply don't have the time to spend on this, so... can anyone help with this? If we can adjust the LastFMImport.vbs script in this way, i'm pretty sure this will bridge the gap between android and MM. To any of you scripters out there, please help!

Also, if you are the dev of the script, please reply! :)

Thoughts?
MM5 latest [Gold] / MMA latest | OnePlus 8 PRO | Noise I make: Pushkin on Soundcloud
Image
Post Reply