SQL-Viewer 2.4 [Script] 2009-10-25

Post a reply

Visual Confirmation

To prevent automated access and spam, you are required to confirm that you are human. Please place a check mark next to all images of monkeys or apes. If you cannot see any images, please contact the Board Administrator.

Smilies
:D :) :( :o :-? 8) :lol: :x :P :oops: :cry: :evil: :roll: :wink:
BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON
Topic review
   

Expand view Topic review: SQL-Viewer 2.4 [Script] 2009-10-25

Re: SQL-Viewer 2.4 [Script] 2009-10-25

Post by Daneel » Sun Jan 01, 2012 1:37 pm

hey

my first installation of media monkey 4 was good because i didnt know that it can be installed in portable mode . so i installed it and made it portable myself as i always do and nothing went wrong

the problem appeared when i wanted to install it on my other pc and this time i noticed the portable check box and i installed it on my previous portable folder .
this is what happened to the music paths in my library
Image

as you can see the start (shared) section of the path which was d:\media\audio\music has changed to [MUSIC] and i dont know how to fix it. i hoped that by writing a config line like this [music]=d:\media\audio\music\ would solve the problem but despite trying all the combinations i could guess , im still unable to fix this problem. please help

thanks in advance

Re: SQL-Viewer 2.4 [Script] 2009-10-25

Post by nynaevelan » Thu Oct 13, 2011 4:44 am

What are the steps you are using to accomplish this, perhaps with that information someone will be able to help you?

Re: SQL-Viewer 2.4 [Script] 2009-10-25

Post by skj88 » Wed Oct 12, 2011 11:48 pm

Actually no, it's not easier to update Genres in MM manually when you have several thousand of them. Isn't that the point of scripts? I can handle doing some manually, but not thousands.

I gave up on SQL and am trying UpdateDB and WriteTags methods with no luck. I will start another thread to try to figure it out.

Re: SQL-Viewer 2.4 [Script] 2009-10-25

Post by nynaevelan » Wed Oct 12, 2011 9:34 am

Out of curiosity wouldn't it be easier to add the genre's via the native MM way? But using this script, what sql are you using, are you sure the tags are being saved with the new genre's?? Try syncronizing them after you run the sql.

Re: SQL-Viewer 2.4 [Script] 2009-10-25

Post by skj88 » Wed Oct 12, 2011 12:52 am

I am trying to get this to work with adding new Genres. I can get a new Genre to add to the Songs table, but once I rescan my library, the new genre disappears. I tried adding the new Genre to the Songs table, Genres table and the link between the song and new genre in the GenresSongs table, but still the new Genre disappears when I rescan the library.

Any suggestions for adding new Genres with SQL?

Thanks

Steve

Re: SQL-Viewer 2.4 [Script] 2009-10-25

Post by bonjo » Sat Jun 11, 2011 4:59 pm

A few minutes. It "took some time" means compared to the wrong code :wink:

Re: SQL-Viewer 2.4 [Script] 2009-10-25

Post by Bex » Sat Jun 11, 2011 11:48 am

Great, how long time did it take? (It should be pretty fast.)

What's the difference between \\xyz\ and :\xyz\

The driveletter is not stored in the path field in the database. I.e all paths starts with :\xyz\. If you use UNC path then do the paths start with \\xyz\ (\\DEVICENAME\folder).

Re: SQL-Viewer 2.4 [Script] 2009-10-25

Post by bonjo » Sat Jun 11, 2011 11:28 am

Hey, thanks, it worked. Took quite some time, but with 12500 songs, no wonder.
Don't forget to restart MM!

What's the difference between \\xyz\ and :\xyz\
I would have thought that the \\xyz searches anywhere in the path, whereas :\xyz searches only including the leading colon from right after the drive letter?

Re: SQL-Viewer 2.4 [Script] 2009-10-25

Post by Bex » Sat Jun 11, 2011 6:33 am

Actually, changing the drive letter would still make the songs playable since MM uses the driveID of a drive to locate it. The reason it doesn't work now is that you have changed the folder. To make it work again, do like this:

1. Back up your database!

2. Run this statement: (Use either button.)
Code: Select all
UPDATE Songs SET SongPath = REPLACE(SongPath, ':\jaBU\iMusic\', ':\2 Music\')
WHERE SongPath like ':\jaBU\iMusic\%';

3. Let me know it it worked.

Re: SQL-Viewer 2.4 [Script] 2009-10-25

Post by bonjo » Sat Jun 11, 2011 6:17 am

Hi. I have a quite similar problem, but I can't get it SQL-Viewer to do the work:
I changed the volume character (from H: to N:) on an external drive containing my music and also the path to the music folder:
old: H:\jaBU\iMusic\
new: N:\2 Music\
Then I opened MM and found all my music, under the new drive letter, but within the old path: N:\jaBU\iMusic\
All songs are displayed black, but when trying to play, they turn grey and don't play.
I am completely new to SQL-Viewer and have no coding experience whatsoever. I entered the following into the window:
Code: Select all
UPDATE Songs SET SongPath = REPLACE(SongPath, '\\jaBU\iMusic\', '\\2 Music\')
WHERE SongPath like '\\jaBU\iMusic\%';

Then I hit 'Run Select Query' (although I am not sure what the buttons mean): 0.234 sec, nothing happens (except #____ in the bottom window).
Then I hit 'Execute DDL/DML Statement': Information window 'Statement Successfully Executed in 0,344 sec'
Nothing has changed with the songs.
Please help :-?

Re: SQL-Viewer 2.4 [Script] 2009-10-25

Post by Bex » Tue May 24, 2011 5:16 pm

SQL can only change the path in MM's database. But I guess that's what you want to do?

1. What is the incorrect path in your database?
2. What do you want to update it to in MM's database?

Re: SQL-Viewer 2.4 [Script] 2009-10-25

Post by timelezz » Tue May 24, 2011 4:52 pm

Hmmm... did not do the job jet. I went to the folder in MM. Selected all those entries. Then started the Script SQL viewer. Entered the code in the big box in the middle and hit RUN Select Query. It took about 7 seconds and 0 rows.

I'm totally new to SQL viewer. Maybe I do sth wrong?

Re: SQL-Viewer 2.4 [Script] 2009-10-25

Post by Bex » Tue May 24, 2011 2:14 pm

If I understand you correctly this should do it, but please back up your database first!
Code: Select all
UPDATE Songs SET SongPath = REPLACE(SongPath, '\\Algemeen\d\mp3\', '\\Algemeen\mp3\')
WHERE SongPath like '\\Algemeen\d\mp3\%';

Re: SQL-Viewer 2.4 [Script] 2009-10-25

Post by timelezz » Tue May 24, 2011 11:49 am

Can someone help me out? I also need to change the folder name. But the folders are on a different PC, within the same network group.

It was: \\Algemeen\d\mp3\
must be: \\Algemeen\mp3\

Can you please make the query for me? I'm totally not experienced and am afraid I will screw it all up.

Re: SQL-Viewer 2.4 [Script] 2009-10-25

Post by nynaevelan » Tue May 24, 2011 10:35 am

I've used it with mm4 but I have not tested it with any of the new fields that are in mm4.

Top