Page 11 of 17
Re: SQL-Viewer 2.3 [Script] 2008-05-15 [MM3]
Posted: Fri Dec 26, 2008 7:14 pm
by Owyn
Bex:
Conflict between installing your script and the 1201+ upgrade process adding the new Export to OPML script.
Test case:
Clean install 1190 (new AppData MediaMonkey folder)
Install SQL Viewer
Install / upgrade to 1204.
The Export to OPML section does not get added to scripts.ini.
Works fine if I don't install SQL Viewer.
I think it might be caused by no blank line preceding the SQL Viewer section in scripts.ini.
See
Mantis 3252
Re: SQL-Viewer 2.3 [Script] 2008-05-15 [MM3]
Posted: Sat Dec 27, 2008 9:14 am
by Bex
Hmm, I don't have any Export to OPML script either.

Well, I have the script file but no Scripts.ini entry for it.
I don't think it's due to SQL-Viewer though. It seems that the OPML script fails to install properly (i.e. add the scripts.ini part) if your scripts.ini contains custom scripts. Sounds very strange though.
Re: SQL-Viewer 2.3 [Script] 2008-05-15 [MM3]
Posted: Sat Dec 27, 2008 9:24 am
by nynaevelan
I have two 3.1 installations, the one with scripts installed I do not have the script.ini entry for opml, the installation without any scripts has both the vbs file and the scripts.ini entry so something must be preventing it from being installed...
Nyn
Re: SQL-Viewer 2.3 [Script] 2008-05-15 [MM3]
Posted: Sun Dec 28, 2008 1:09 pm
by Bex
The "Export to OPML"-script issue is fixed by Ludek in build 1205.
Re: SQL-Viewer 2.3 [Script] 2008-05-15 [MM3]
Posted: Tue Jan 13, 2009 1:03 pm
by Teknojnky
Anyone know off hand what the sql update would be to clear all album volume level, only for db? Basically I want to clear it and let MM recalc and update in the background without having to clear it from 150k tracks too.
Re: SQL-Viewer 2.3 [Script] 2008-05-15 [MM3]
Posted: Tue Jan 13, 2009 1:51 pm
by nynaevelan
Here's what I use:
Code: Select all
UPDATE Songs SET NormalizeTrack ='-999999.0' WHERE NormalizeTrack > '-999999.0'
Nyn
Re: SQL-Viewer 2.3 [Script] 2008-05-15 [MM3]
Posted: Tue Jan 13, 2009 1:54 pm
by Teknojnky
Thanks, I'll give it go tonite.
Re: SQL-Viewer 2.3 [Script] 2008-05-15 [MM3]
Posted: Tue Jan 13, 2009 1:55 pm
by gege
Teknojnky wrote:Anyone know off hand what the sql update would be to clear all album volume level, only for db? Basically I want to clear it and let MM recalc and update in the background without having to clear it from 150k tracks too.
What about
Undo Volume Analyzing script?
It is a bit old, but I think it will work, with some tweaks...
You'll probably need to replace these lines...
Code: Select all
Sng.Leveling=-999999
Sng.UpdateDB
Sng.WriteTags
... by these...
Code: Select all
Sng.LevelingAlbum=-999999
Sng.UpdateDB
'Sng.WriteTags
... in order to have Album Leveling cleared (instead of Song Leveling) and only DB updated, not tags.
Of course, it will take you more time to complete the task than an SQL update...
Edit: Ok, nyn, you've beaten me

Re: SQL-Viewer 2.3 [Script] 2008-05-15 [MM3]
Posted: Tue Jan 13, 2009 1:58 pm
by nynaevelan
Since we're on the subject of sql statements is there a way to create an autoplaylist or an sql statement that would identify albums that have some tracks with an original date??
Gege:
I thought of that but it is not as quick as SQL Viewer...
Nyn
Re: SQL-Viewer 2.3 [Script] 2008-05-15 [MM3]
Posted: Tue Jan 13, 2009 2:46 pm
by Bex
Teknojnky wrote:Anyone know off hand what the sql update would be to clear all album volume level, only for db? Basically I want to clear it and let MM recalc and update in the background without having to clear it from 150k tracks too.
This will do it. No WHERE clause is needed since you want to update all tracks:
Album level:
Code: Select all
UPDATE Songs SET NormalizeAlbum =-999999.0
Track level:
Code: Select all
UPDATE Songs SET NormalizeTrack=-999999.0
(You know Tekno, but to others:)
Note that the tag of the tracks is not affected only the database.
Re: SQL-Viewer 2.3 [Script] 2008-05-15 [MM3]
Posted: Tue Jan 13, 2009 2:52 pm
by Bex
nynaevelan wrote:Here's what I use:
Code: Select all
UPDATE Songs SET NormalizeTrack ='-999999.0' WHERE NormalizeTrack > '-999999.0'
Nyn
Even though this one works there is no need to use ' around Number fields. But SQLite is very forgiving and understands it anyway!
NormalizeTrack is for tracks I guess you meant NormalizeAlbum.
Re: SQL-Viewer 2.3 [Script] 2008-05-15 [MM3]
Posted: Tue Jan 13, 2009 3:01 pm
by Bex
nynaevelan wrote:Since we're on the subject of sql statements is there a way to create an autoplaylist or an sql statement that would identify albums that have some tracks with an original date??
Gege:
I thought of that but it is not as quick as SQL Viewer...
Nyn
Here you go:
Code: Select all
SELECT ID, Artist, SongTitle, Album, OrigYear FROM Songs WHERE IDAlbum IN
(SELECT IDAlbum FROM Songs
GROUP BY IDAlbum
HAVING COUNT(CASE WHEN OrigYear<=0 THEN 1 ELSE NULL END)<COUNT(*))
If you want I can add it to TI?
Re: SQL-Viewer 2.3 [Script] 2008-05-15 [MM3]
Posted: Tue Jan 13, 2009 3:09 pm
by nynaevelan
Yes I would LOVE it if you added it to TI, but can you make one minor adjustment to the SQL, can you add the feature to have the results sent to a playlist? The playlist id is 7447.
Nyn
Re: SQL-Viewer 2.3 [Script] 2008-05-15 [MM3]
Posted: Tue Jan 13, 2009 3:25 pm
by Bex
Sure!
Code: Select all
INSERT INTO PlaylistSongs (IDPlaylist, IDSong) SELECT ThePlaylistIdHere, Songs.ID FROM songs WHERE bla bla bla
ThePlaylistIdHere=7447
bla bla bla=
Code: Select all
IDAlbum IN
(SELECT IDAlbum FROM Songs
GROUP BY IDAlbum
HAVING COUNT(CASE WHEN OrigYear<=0 THEN 1 ELSE NULL END)<COUNT(*))
Give this:
Code: Select all
INSERT INTO PlaylistSongs (IDPlaylist, IDSong) SELECT 7447, Songs.ID FROM songs WHERE IDAlbum IN
(SELECT IDAlbum FROM Songs
GROUP BY IDAlbum
HAVING COUNT(CASE WHEN OrigYear<=0 THEN 1 ELSE NULL END)<COUNT(*))
A new node will added to TI in the next version!

Re: SQL-Viewer 2.3 [Script] 2008-05-15 [MM3]
Posted: Tue Jan 13, 2009 3:37 pm
by nynaevelan
Thanks for the SQL and the future update to TI.
Nyn