WISHLIST: <ID> field for mask sections

Any ideas about how to improve MediaMonkey? Let us know!

Moderator: Gurus

WISHLIST: <ID> field for mask sections

Postby markstuartwalker » Wed May 18, 2011 2:46 am

I would like to have the ability to sync files to a USB stick and name them as the MM Songs.ID field.

It would be an expansion of http://www.mediamonkey.com/wiki/index.php/Scripting_Resources#Masks_sections_in_MediaMonkey.ini

Something along the lines of

%I <ID>

This would allow export of the tracks to a plugged in player and allow perfect tracking of playcounts.
Windows 7 SP1 x64 / Ubuntu 11.10 / Lion 10.7.3 / iOS 5.1 / iTunes 10.6.0
iTunes plugin (d_itunes & itunes4) viewtopic.php?f=2&t=45713
Running MM under Mac OS X with Wine viewtopic.php?f=4&t=58507
markstuartwalker
 
Posts: 868
Joined: Fri Jul 10, 2009 8:10 am

Re: WISHLIST: <ID> field for mask sections

Postby mcow » Wed May 18, 2011 5:36 pm

+1
mcow
 
Posts: 440
Joined: Sun Sep 21, 2008 9:35 pm
Location: Cupertino, California

Re: WISHLIST: <ID> field for mask sections

Postby Peke » Wed May 18, 2011 6:54 pm

Can you two elaborate a little using practical example and stating device that will support that? I do not see the need for it especially as it is MM library ID intended for internal Usage.

I'm guessing what you ask but to explain you better I would like to see example of usage.
Best regards,
Pavle
MM Core Developer and Fan (check HAPPYMONKEYING Site)
Image
Image
Peke
 
Posts: 7546
Joined: Tue Jun 10, 2003 7:21 pm
Location: Serbia

Re: WISHLIST: <ID> field for mask sections

Postby markstuartwalker » Thu May 19, 2011 2:16 am

I am using the USB plugin to create a file stricture which I shall later import into iTunes on my mac.

The <Id> entry would allow me to name thefiles with the MM ID. Later on I can use the Last Played playlist and the ID to increase the playcounts in MM.
Windows 7 SP1 x64 / Ubuntu 11.10 / Lion 10.7.3 / iOS 5.1 / iTunes 10.6.0
iTunes plugin (d_itunes & itunes4) viewtopic.php?f=2&t=45713
Running MM under Mac OS X with Wine viewtopic.php?f=4&t=58507
markstuartwalker
 
Posts: 868
Joined: Fri Jul 10, 2009 8:10 am

Re: WISHLIST: <ID> field for mask sections

Postby mcow » Thu May 19, 2011 12:20 pm

The reason being: on re-syncing, to update the db from the device, you want a handle in the device track that will guarantee to map to the original track in the db. If the filename is (or includes) the ID, then it's simple.

I suppose using a ID3 field to store the ID value would work as well, but using it as a mask in the filename is easy.
mcow
 
Posts: 440
Joined: Sun Sep 21, 2008 9:35 pm
Location: Cupertino, California

Re: WISHLIST: <ID> field for mask sections

Postby markstuartwalker » Fri May 20, 2011 1:34 am

Correct. I used to use the Season Number field in iTunes.

Puttimg it in the field name is alot easier.
Windows 7 SP1 x64 / Ubuntu 11.10 / Lion 10.7.3 / iOS 5.1 / iTunes 10.6.0
iTunes plugin (d_itunes & itunes4) viewtopic.php?f=2&t=45713
Running MM under Mac OS X with Wine viewtopic.php?f=4&t=58507
markstuartwalker
 
Posts: 868
Joined: Fri Jul 10, 2009 8:10 am

Re: WISHLIST: <ID> field for mask sections

Postby wtanksleyjr » Sat Sep 17, 2011 12:21 am

Another example: I have a nice enough MP3 player that chokes on playlists containing songs with non-ASCII chars in their paths. If only there were some way to force MM to write a track without potentially writing the non-ASCII stuff that so many tracks normally use (podcasts, by the way, so I can't simply fix the problem). An <id> field would do that perfectly. (An autonumber field doesn't help, because it changes every time a playlist order changes; the resulting sync is WAY slower than needed.)
wtanksleyjr
 
Posts: 21
Joined: Fri Dec 11, 2009 9:40 am

Re: WISHLIST: <ID> field for mask sections

Postby wtanksleyjr » Wed Sep 21, 2011 11:01 am

I DID IT! This can be done with a simple script and a minor configuration change.

The script contains the single executable line: SDB.database.execSQL("UPDATE Songs SET Custom1 = ID where Custom1 is null or Custom1 <> ID"). Run it before syncing, or after adding things to the database. (Ideally it would be run on a single track after adding it, but I need to work that out if I can.)

At this point the <Custom 1> tag will contain the DB ID -- but it gets better. Now, go into the menu to Tools->Options->Library/Appearance -> Rename Custom..., and change "Custom 1" to "DB ID".

BINGO! From now on, the tag <DB ID> will be replaced with the database ID in all situations after that script has been run (i.e. I wouldn't use it to specify podcast episode locations, since the script won't have run).

Problem solved.

I'd like to bundle this into an MMIP extension, but first I need to figure out triggers to make this truly automatic. I'm a little bit worried about someone else using "Custom1" for their own purposes, but I think I'll just write the extension and wait for problems to turn up -- I've thought of several solutions, but they're all complex, so I'd rather see if they're needed.

Any interest?

-Wm
wtanksleyjr
 
Posts: 21
Joined: Fri Dec 11, 2009 9:40 am

Re: WISHLIST: <ID> field for mask sections

Postby Lowlander » Wed Sep 21, 2011 11:17 am

Consider the PUID which allows users to choose which field to save the PUID in.
Lowlander
 
Posts: 31647
Joined: Sat Sep 06, 2003 5:53 pm

Re: WISHLIST: <ID> field for mask sections

Postby wtanksleyjr » Fri Apr 27, 2012 11:49 am

I don't know what a PUID is, unless it's the ID used by the National Archives of the United Kingdom; that might be nice to have, but I doubt it's available for all my podcasts.

But I did find a way to write a trigger, so that the "<DB ID>" field I mentioned above actually gets updated. I've bundled it into an MMIP file (so you can simply double-click the file and Mediamonkey will set everything up for you), and I will upload once I get it working on MM4 (it worked on MM3, but dies on MM4).
wtanksleyjr
 
Posts: 21
Joined: Fri Dec 11, 2009 9:40 am

Re: WISHLIST: <ID> field for mask sections

Postby wtanksleyjr » Sat Apr 28, 2012 6:20 pm

I DID IT! After you install the extension I wrote, you'll have a field named "<DB ID>" for use in filenames and so on (note the space in "DB ID"). I use it to name files I sync to my Droid, for example -- my media player doesn't like Unicode, and some of my podcasts use Unicode names.

The only catch is that it uses your "Custom 1" field. If you're using that field for any other purpose, you'll want to hold off installing DBID, and let me know (posting here would be fine); I know of some workarounds, but I was too lazy to implement them. If you don't know what I'm talking about, odds are good that you don't need to worry about it; but if you are worried, ask here and it'll put some pressure on me to think about fixing it.

I've tested this well under MM4 on Windows XP, and used it for a long time under MM3. The install/uninstall is a little new, but it's very simple and seems to work well.

Click on this link to download a file named "dbid.mmip" (it's in the "dbid" folder). Double-click on it to install -- MediaMonkey will open and pop up a dialog box asking whether you want to install it. (I provided an uninstall as well, if you decide for any reason you don't want it.)

-----

If you don't want to install without knowing what's in it, use an unzip program to open up dbid.mmip; you'll find all the source. It's pretty simple.

What this does, technically and in short: it copies the "ID" field of the Songs table into the Custom1 field of the same table. It also modifies the MediaMonkey.ini file so that "Custom1" will be named "DB ID", and can be referred to by that name. Finally, it installs a "trigger" to maintain the table so that every mediamonkey track always has the correct value in that DB ID/Custom1 field.

Very simple!

-Wm
wtanksleyjr
 
Posts: 21
Joined: Fri Dec 11, 2009 9:40 am

Re: WISHLIST: <ID> field for mask sections

Postby wtanksleyjr » Fri May 04, 2012 2:04 pm

I edited my post to change the link to point you to the most recent version. I had some troubles with the old one missing some new tracks -- not certain whether I fixed 'em, but I think I did.
wtanksleyjr
 
Posts: 21
Joined: Fri Dec 11, 2009 9:40 am

Re: WISHLIST: <ID> field for mask sections

Postby wtanksleyjr » Fri Dec 28, 2012 5:44 pm

I uploaded a new version that's a lot less wasteful; my old version was REALLY bogging down once the library got big. Just follow the instructions above to install it. (It's version 1.2, if you care.)
wtanksleyjr
 
Posts: 21
Joined: Fri Dec 11, 2009 9:40 am


Return to Wishlist (mmw)

Who is online

Users browsing this forum: Bing [Bot] and 5 guests