Page 6 of 28

Re: SQL Error

Posted: Mon Feb 04, 2008 3:44 pm
by sbondi
jn wrote:I'm using the latest (4-Feb-08) version; however I get the following error message:

The INI section for this is

Code: Select all

[Zur Bibliothek hinzugefügt...]
icon=Year

[heute]
icon=Year
sortLike=Genre
level=Genre
levelEasyCaption=BaseCaptionAndTrackCount
trackCriteria="((CAST([vb]CDbl(Now)[vb] AS Integer)) - CAST(DateAdded AS Integer) = 0)"
parent="Zur Bibliothek hinzugefügt..."
which basically is from your ini file. There are other sections with similar errors as well.

Any help?


Jörg
Hi jn,

Apparently my script is not "localized", since the VBScript code is outputting a value in your local format which uses a comma (instead of a period) when outputting a real value (to split the integer from the decimal portion) and appears as a parameter delimiter to SQLite. I will work on an update for later today with <easyCaptions> using a safer version of "CDbl(Now)" that should work everywhere.

In the meantime, change your <trackCriteria> to:

[revised]

Code: Select all

trackCriteria="(([vb]Fix(Now)[vb] - CAST(DateAdded AS Integer)) = 0)"
Let me know if it works.

Regards,

Steve

Re: SQL Error

Posted: Mon Feb 04, 2008 8:36 pm
by sbondi
nynaevelan wrote:
jn wrote:I'm using the latest (4-Feb-08) version; however I get the following error message:

The INI section for this is

Code: Select all

[Zur Bibliothek hinzugefügt...]
icon=Year

[heute]
icon=Year
sortLike=Genre
level=Genre
levelEasyCaption=BaseCaptionAndTrackCount
trackCriteria="((CAST([vb]CDbl(Now)[vb] AS Integer)) - CAST(DateAdded AS Integer) = 0)"
parent="Zur Bibliothek hinzugefügt..."
which basically is from your ini file. There are other sections with similar errors as well.

Any help?


Jörg
Your code should be:

Code: Select all

trackCriteria="((CAST(#VB#CDbl(Now)#VB# AS Integer)) - CAST(DateAdded AS Integer) = 0)" 
Are you using samples from the latest ini, Steve changed the code.

Nyn
Hi Nyn,

jn is using the correct version (actually the #VB# one is the old one).

The problem was the VBScript real number was output in a locale where a comma is used to delimit the integer portion from the decimal portion. Thus, the comma erroneously looked like it was delimiting another parameter to SQLite.

I posted the safer syntax, and I am modifying the <easyCriteria> now.

Thanks for your support,

Steve

Posted: Mon Feb 04, 2008 8:44 pm
by nynaevelan
OOps :oops: , I need to check the ini at work because that is the code I am using there, but my ini at home is the correct one, sorry Jorg.

Nyn

Here comes another one ...

Posted: Tue Feb 05, 2008 12:52 am
by sbondi
Okay, I realized how to fully support the MM3 multi-value field design, so I have just posted a release with support for [Conductor] and [Lyricist] (with their respective option switches), and I improved the performance for all multi-value fields. Only the special [PrimaryArtist] and [GuestArtist] levels have a minor additional assumption (i.e., no space before first value or between first value and ";").

Also, thanks to Jorg, I modified all <easyCriteria> with "day differencing" to avoid outputting real numbers that would cause SQLite errors in certain locales.

Note: Add any or all of the following to any existing .INI [Options] sections to support the applicable feature:

supportMultiValueFieldForConductor=1
supportMultiValueFieldForLyricist=1

[Nyn] and [spacefish], please retest your last issues with this release, and let me know the results. Thanks :D

Posted: Tue Feb 05, 2008 1:37 pm
by jn
Steve,

your help is much appreciated.
With today's version (05Feb08), the followin should be OK, right?

Code: Select all


[heute]
icon=Year
sortLike=Genre
level=Genre
levelEasyCaption=BaseCaptionAndTrackCount
easyCriteria=AddedToday
parent="Zur Bibliothek hinzugefügt..."
However, when MM starts up, I get
Image

Moreover, the following

Code: Select all

[letzte Woche]
icon=Year
sortLike=Album
hideifempty=1
level=Artist
levelEasyCaption=BaseCaptionAndNodeCount
level=Album
easyCriteria=AddedWithinTheLast7Days
parent="Zur Bibliothek hinzugefügt..."
yields
Image

Looks to me like even more localization issues :cry:

Posted: Tue Feb 05, 2008 1:46 pm
by sbondi
jn wrote:Steve,

your help is much appreciated.
With today's version (05Feb08), the followin should be OK, right?

Code: Select all


[heute]
icon=Year
sortLike=Genre
level=Genre
levelEasyCaption=BaseCaptionAndTrackCount
easyCriteria=AddedToday
parent="Zur Bibliothek hinzugefügt..."
However, when MM starts up, I get

Moreover, the following

Code: Select all

[letzte Woche]
icon=Year
sortLike=Album
hideifempty=1
level=Artist
levelEasyCaption=BaseCaptionAndNodeCount
level=Album
easyCriteria=AddedWithinTheLast7Days
parent="Zur Bibliothek hinzugefügt..."
yields
Image

Looks to me like even more localization issues :cry:
Jorg,

Sorry about that :(

Yes, these are localization issues which I thought should have been resolved. I will change my locale and test a little more, and then send out an update.

Posted fix for "date differences"

Posted: Tue Feb 05, 2008 2:07 pm
by sbondi
Jorg,

Please try this second release and let me know if it works for those 2 nodes of yours.

FYI, the "Fix(Now)" was not always working even for the "US" locale. But, I tested "Fix(CDbl(Now))" for a few locales (including "Germany") and it now works.

Regards,

Steve

Posted: Tue Feb 05, 2008 3:52 pm
by jn
Steve,

it now works like a charm with AddedToday, AddedYesterday and AddedWithinTheLast7Days. Thank you again for your quick and kind support.

Jörg

Posted: Tue Feb 05, 2008 4:06 pm
by sbondi
jn wrote:Steve,

it now works like a charm with AddedToday, AddedYesterday and AddedWithinTheLast7Days. Thank you again for your quick and kind support.

Jörg
You are welcome, Jörg.

Let me know if you need any additional features, since the script is now set up for fairly quick and easy modifications.

Release 3 today with more stuff!

Posted: Wed Feb 06, 2008 12:09 am
by sbondi
Just posted a third release with the following:

-- fixed bug with <trackcount> not displaying (when combined with other counts) in <customCaption> (thanks, Nyn!)

-- added suffixes for <level> captions that are purely numeric: [Bitrate] kbps, [BPM] bpm, [Rating] stars

-- added support for appending <levelEasySort>

-- added some <levelEasySort> items

-- validated <level> when loading .INI

Issue with script when playing tracks

Posted: Thu Feb 07, 2008 12:03 pm
by sbondi
[spacefish] has pointed out some issues with this script's "refresh" features while songs are being played in the MM3 player. I am sorry for any inconvenience that this may have caused for some of you.

First, the symptoms are:

1. MM3 stalls briefly on track change, simulating a "gap" between tracks.
2. Temporary pause during playback when you edit the properties of other tracks
3. Tree navigation flickers briefly when you edit the properties on multiple tracks

All these items relate to the script's <refreshWithTracksChanged> option which has requested to MM3 to be informed of any track property changes in the database. When such an event occurs, the script goes through its "refresh" cycle which basically "tests" all of custom nodes that have the <refresh> option enabled. This involves querying the database for the current count based on the node's <trackCriteria> to determine to <hideIfEmpty> (or unhide if not) in addition to querying for any <customCaption> counts. This can be somewhat process-intensive and database-intensive if you have a decent amount of custom nodes and complex <trackCriteria> or <customCaptions>, and can slow down/affect other operations (depending how slow your computer's CPU speed is) like the current track playing.

The first symptom relates to MM3 changing the "PlayedCounter" at the end of each track play. Since this is a change to the database and essentially to the track's properties, this triggers the global MM3 "OnTrackProperties" event, and results in the "refresh" cycle described above. A lot of process-intensive and database-intensive stuff happens and slows down the system (depending on your CPU speed) to the point of creating a "gap" before the next track can play.

The second and third symptoms relate to when you edit properties while a track is also playing in the MM3 player. The same "refresh" cycle described above will be executed while a track is playing, and thus would cause "pauses" or "flickers".

For now, if this issue affects you, you can set the "refreshWithTracksChanged=0".

I will research some additional options to better handle this situation.

New release to hopefully resolve or minimize "gaps"

Posted: Thu Feb 07, 2008 8:34 pm
by sbondi
Just posted an update with logic to reduce the script "hogging" up all MM3 processing during the "refresh" cycle. Hopefully this will resolve or minimize the "gaps" issue that [spacefish] is experiencing.

Also, thanks to Nyn, the sample .INI has some additional sophisticated nodes that you can use or modify.

You asked for it ...

Posted: Fri Feb 08, 2008 12:06 am
by sbondi
... and I have posted a release with a "refresh" option, so that you can quickly see your new nodes after editing your .INI file - without having to exit MM3 and re-enter.

Just select the "Refresh MyCustomNodes from Updated .INI file" menu item from the "Edit" menu.

Posted: Fri Feb 08, 2008 12:11 am
by cadmanmeg
For us non-scipters, can a new .ini file be uploaded for use with this? As I remember correctly, if I try to use the old one I have from an update a few days ago, the script won't work correctly. Thanks in advance.

Posted: Fri Feb 08, 2008 12:20 am
by sbondi
cadmanmeg wrote:For us non-scipters, can a new .ini file be uploaded for use with this? As I remember correctly, if I try to use the old one I have from an update a few days ago, the script won't work correctly. Thanks in advance.
Hi cadmanmeg,

There have been no format changes for a few days now, and there will probably not be any more. Thus, if your .INI worked with any of the releases over the last 5 days, then it will work with no problem for this latest release. The only thing I have added are extra options that you can optionally use if you add them to the [Options] section.

Note, the sample .INI provided has lots of nodes and some internal notes to guide you. Is this not good enough for you?

I think you may be referring to Nyn's own .INI file which she published when I first released the script. Some of her nodes from her .INI are in the provided sample .INI.

If there are special nodes that you liked from Nyn's .INI file which are not in the sample .INI file, then let me know, and I can add them into the sample .INI file for your convenience.

Regards,

Steve