4.0 trigger addon no longer firing?

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

Moderator: Gurus

Posts: 31
Joined: Fri Dec 11, 2009 9:40 am

4.0 trigger addon no longer firing?

Post by wtanksleyjr » Thu Jan 23, 2014 8:41 pm

I created a plugin for 4.0 that adds a database trigger (it copies the Song.ID field to Song.Custom1 so I can have a guaranteed unique filename for tracks). It's been working since the beta phase.

In Portable, however, it only works until I exit MediaMonkey. Next time I restart, any newly added tracks have blank fields until I re-install my plugin.

Has something changed in database triggers?

Here's my Install.vbs (Install.ini simply runs this, I don't expect to need to copy the file in):

Code: Select all

' Modify mediamonkey.ini to support the <DB ID> tag.
Dim ini: Set ini = SDB.IniFile
' I should technically look for an unused custom field, rather than just
' taking the first one. Oh well.
ini.StringValue("CustomFields","Fld1Name") = "DB ID"

' Preload all known song IDs into the custom field.
SDB.database.execSQL("UPDATE Songs SET Custom1 = ID where Custom1 <> ID")
' Tell the database to automatically place all DB IDs into the Custom1 field
' when new entries are made.
SDB.database.execSQL("drop trigger if exists dbid_maintenance")
SDB.database.execSQL("create trigger dbid_maintenance after insert on Songs" _
                    & " begin UPDATE Songs SET Custom1 = ID" _
                    & "  where rowid=new.rowid" _
                    & "; end")

Posts: 31
Joined: Fri Dec 11, 2009 9:40 am

Re: 4.0 trigger addon no longer firing?

Post by wtanksleyjr » Wed Jan 29, 2014 1:50 pm

Changing the name of the trigger doesn't help.

Nobody? Crickets? Help...

OK, if that's no good, then _how can I fix Mediamonkey_????? Right now there's no way to reliably sync podcasts, because all of Mediamonkey's supported fields can be blank, contain characters that are illegal in filenames, or are duplicates of other filenames. No matter what naming I choose, it's ALWAYS possible that MM will happily and without _any_ notice will overwrite a file or put them into a path that can't be accessed.

Posts: 46503
Joined: Sat Sep 06, 2003 5:53 pm
Location: MediaMonkey 5

Re: 4.0 trigger addon no longer firing?

Post by Lowlander » Wed Jan 29, 2014 1:59 pm

Illegal characters should be replaced on sync, if this isn't the case report which characters are causing issues.

You may want to use <Auto Number> or <Random> in your folder/filenames to create unique filenames: http://www.mediamonkey.com/wiki/index.p ... ormats/4.0
Lowlander (MediaMonkey user since 2003)

Post Reply