Playlist Song Replacer 1.0 (5/25/2008) [MM3]

Post a reply

Smilies
:D :) :( :o :-? 8) :lol: :x :P :oops: :cry: :evil: :roll: :wink:

BBCode is ON
[img] is ON
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Playlist Song Replacer 1.0 (5/25/2008) [MM3]

Re: Playlist Song Replacer 1.0 (5/25/2008) [MM3]

by nynaevelan » Sat Jul 12, 2008 7:03 am

MDominik:

Would it be possible to add an additional option that instead of replacing the selected track, but would add the replacement track after the track in the selected playlist(s)? I have a few songs in certain situations where I would like them to play together.

Nyn

by MDominik13 » Sun May 25, 2008 10:56 pm

New version has been released:
* Toolbar button to delete songs. This one checks playlists first and launches the Replacer if any songs exist in a playlist.
* Option sheet to configure certain settings

by nynaevelan » Sat May 03, 2008 7:39 pm

Yes I have the two indexes, don't change anything yet. Let me run it a few more times to see if I continue to run into the same problem.

Nyn

by MDominik13 » Sat May 03, 2008 7:30 pm

Check to make sure you have the index:
SELECT name FROM sqlite_master
WHERE type='index' and tbl_name = 'PlaylistSongs'
ORDER BY name

You should get back two records ('idxPlaylistSongsPlaylist' and 'idxPlaylistSongsSong'). 12,000 is not a very big table. I'm no SQLite pro but the query should have run quickly with or without an index.

I run the script as a modal form so I wonder if a messagebox popped up behind it (probably the confirmation window or an error message). I've had that happen before with other scripts and programs. If it happens again, try using ALT + TAB to switch programs. It might expose the hidden message box. If this is the case, I can change the script so it's not modal and that will solve the problem.

by nynaevelan » Sat May 03, 2008 7:05 pm

MDominik13 wrote:
If you have Bex's SqlViewer script (which is awesome by the way), run these queries and send me the results:
I agree and I don't even know SQL. 8)
MDominik13 wrote:SELECT COUNT(*) FROM PLAYLISTSONGS
12133
MDominik13 wrote:SELECT IDPLAYLIST, COUNT(*) FROM PLAYLISTSONGS GROUP BY IDPLAYLIST
# IDPLAYLIST COUNT(*)
01 3132 48
02 3133 71
03 3134 16
04 3135 25
05 3136 13
06 3137 34
07 3138 12
08 3139 60
09 3140 37
10 3141 162
11 3142 12
12 3143 23
13 3144 18
14 3145 24
15 3146 37
16 3147 86
17 3148 157
18 3149 22
19 3150 62
20 3151 17
21 3152 51
22 3153 38
23 3154 12
24 3155 13
25 3156 20
26 3157 14
27 3158 143
28 3159 67
29 3161 25
30 3162 35
31 3163 81
32 3164 40
33 3165 97
34 3166 29
35 3167 57
36 3168 52
37 3169 40
38 3170 64
39 3172 21
40 3173 195
41 3174 35
42 3175 22
43 3176 49
44 3177 18
45 3178 12
46 3179 27
47 3180 58
48 3181 132
49 3182 40
50 3183 6
51 3184 23
52 3185 24
53 3186 9
54 3187 10
55 3188 39
56 3189 21
57 3190 28
58 3191 26
59 3192 17
60 3193 15
61 3194 26
62 3195 20
63 3196 20
64 3197 22
65 3198 25
66 3199 21
67 3200 40
68 3201 22
69 3202 48
70 3203 13
71 3204 31
72 3205 15
73 3206 26
74 3207 23
75 3208 42
76 3209 30
77 3210 14
78 3211 14
79 3212 37
80 3213 14
81 3214 53
82 3215 15
83 3216 12
84 3217 32
85 3218 24
86 3219 42
87 3220 39
88 3221 38
89 3222 23
90 3223 22
91 3224 149
92 3226 2513
93 3228 56
94 3229 29
95 3231 16
96 3232 131
97 3234 1
98 3235 13
99 3236 25
100 3237 22
101 3241 3
102 3243 1
103 3244 1
104 3248 2
105 3249 3
106 3250 1
107 3252 2
108 3253 7
109 3254 1
110 3255 2
111 3256 5
112 3257 3
113 3258 1
114 3259 1
115 3261 3
116 3262 2
117 3266 15
118 3267 15
119 3268 18
120 3269 24
121 3270 22
122 3271 31
123 3272 25
124 3273 32
125 3274 24
126 3275 24
127 3276 15
128 3277 24
129 3278 18
130 3279 16
131 3280 26
132 3281 23
133 3282 24
134 3283 18
135 3284 16
136 3285 32
137 3286 20
138 3287 23
139 3288 32
140 3289 34
141 3290 1
142 3291 22
143 3292 29
144 3293 15
145 3294 29
146 3295 938
147 3296 12
148 3302 50
149 3303 27
150 3314 979

Nyn

by MDominik13 » Sat May 03, 2008 6:59 pm

I'm looking into ways to allow users to type in artist/songs. I can't use a dropdown where you can type in the name because, the way the script runs, it immediately tries to start querying songs on every keystroke. I might try using a timer or maybe just a filter option to reduce the list size.

With regards to the replacement you ran that took a while, that's really odd. The query to replace one song in all playlists is very basic. I checked the indexes on the PlaylistSongs table and there is one on the song ID column. The only thing I can think of is either there was something blocking the DB process or you have a ton of playlist songs. Do you know how many total songs are in your PLAYLISTSONGS table?

If you have Bex's SqlViewer script (which is awesome by the way), run these queries and send me the results:
SELECT COUNT(*) FROM PLAYLISTSONGS

SELECT IDPLAYLIST, COUNT(*) FROM PLAYLISTSONGS GROUP BY IDPLAYLIST

Thanks again for your help!
Mike

by nynaevelan » Fri May 02, 2008 12:06 pm

Hi Mike:

I have one more question and problem:

1. Problem - Having the script replace 1 track in 18 playlists locked MM up for over 5 minutes, I shut it down because I wasn't sure if it was still working or was truly locked up. After reopening MM, all the tracks had been replaced. Is there any way to add a toolbar to show progression?
2. Question - Is it possible to setup the Artist/Title as either the drop down box or allow the user to type in the text for the artist and/or title which will be the replacement song?

Other than that I am content with the script, nice job!! :P

Nyn

by MDominik13 » Fri May 02, 2008 12:37 am

Well I guess that's why we should never test our own code. I don't know how I missed the issue where the song was always replaced with the first song in the list. Thanks for catching that.

Anyhow, I made almost all of the changes you requested (see history above). The only one I haven't done yet is the ability to swap songs in playlists. I'm still thinking about that one.

Thanks for your help!

Mike

by nynaevelan » Thu May 01, 2008 1:04 pm

MDominik13:

I've had a chance to play with the script and I have a problem, a suggestion and a question:

1. In the text that opens once you select the replacement, it lists the first song of the first replacement. For instance, if I replace Song1 with Song2 the text will be 'Replace the song Song1 by Artist with Song1? Then if I suggest another replacement, it still lists Song1.
2. Can you add a confirmation box to let the user know the replacement has occurred, there is no way of knowing whether the script is finished or not.
3. Would it be possible to select several songs and have them replaced by 1 song?

That's it for now.

Nyn

by trixmoto » Thu May 01, 2008 8:28 am

Sounds like a great script, I'll play with it in a next couple of days. I'm glad I managed to help you though, indirectly! :)

by nynaevelan » Wed Apr 30, 2008 10:19 pm

I'll run the new version through the paces and let you know any feedback I have. But I can already tell this is going to be added to the favorites list in no time. :P My db is driven by playlists and playcounts. Since I have over 100 playlists, replacing songs has always been a chore. Between this and Bex's Advanced Dupe & Findscript, playlist management is much easier.

Nyn

by MDominik13 » Wed Apr 30, 2008 9:16 pm

Thanks for the feedback, nyn. I guess I didn't check out the DB schema well enough. I changed how the artist/albums/songs dropdowns are loaded in order to support tracks with multiple artists. Only artists with at least one track will be listed in the artist dropdown and it will now query any track/album where the selected artist is listed (primary or not). I also added an "ALL" option to the album dropdown.

I'd like to offer the ability to specify multiple playlists but I'm not sure how to do it without a multi-select dropdown control. Maybe I can remove the playlist from the dropdown after a replacement is made to a single playlist. You'd have to click the "Replace" button multiple times but at least you wouldn't have to keep rerunning the script. Would that work?

I can probably do the switcher as well. I'll wait on that feature though. I'm still trying to wrap up the import script.

by nynaevelan » Wed Apr 30, 2008 8:12 pm

I have been waiting for something like this for quite some time. :P I have a few questions/problems. I looked at the script but the way it handles artists could pose a problem. If there are multiple artists is there any way to list all the tracks under the primary artist? Also, having the tracks listed by album could pose a problem if you do not know what album the track you are looking for belongs to, is there anyway to have it also list all the tracks without the album limitations? Also, a thought for later, maybe a playlist switcher, where you are switching the songs between playlists. Or, if the song belongs to several playlists and you want to replace it in more than one playlist but not all the existing playlists?

Nyn

Playlist Song Replacer 1.0 (5/25/2008) [MM3]

by MDominik13 » Wed Apr 30, 2008 7:59 pm

Playlist Song Replacer 1.0
Last Update: 5/25/2008

While working on a script to import playlists from various data sources (text file, xml, HTML table, etc), I discovered that I needed a way to replace songs in playlists when the import process didn't choose the song I wanted. I searched the forums and found a few posts that mentioned a replacement script but no actual working scripts.

Big thanks go out to trixmoto. I know I never directly asked you for help but, almost every time I had a question, you had already given the answer in the forum (or I used one of your scripts as a guide). The new delete functionality uses your code as well.

Also, Bex's SQL Viewer script was a huge help in testing queries.

Thanks to Nyn for his testing and suggestions!

Description:
The script allows you to select songs and replace them in the same position within selected playlist(s).

Download:
PlaylistSongReplacer.mmip

Playlist Song Replacer Instructions:
1. Select the song(s) you wish to replace
2. Click the "Playlist Song Replacer" toolbar button (or select the option from the "Scripts" menu)
3. Select the playlist where the replacement should be made
4. Select the song to use as the replacement from the dropdowns in the bottom
5a. Click the "Replace" button to make the replacement. You will be prompted for confirmation before the replacement is made
5b. Click "Skip" or "Previous" to move back and forth between the selected songs
5c. Click "Cancel" to exit the script without making any further changes (changes that have already been made will not be undone)

Delete Songs Button
1. Select the songs you wish to delete
2. Click the delete button on the toolbar
3. If the song(s) exist in a playlist, the Playlist Song Replacer form will be launched.
4. When finished, you will be prompted to delete the songs from the computer as well as the library.

NOTES:
* I tried to use tooltips in order to make the script be as user friendly as possible but let me know if you have any questions.

Screenshot:
Image

To do:
Better icons? I'm no artist...

Release History:
1.0
* Added new "delete" toolbar button which will check playlists prior to deleting songs (see instructions above).
* Added option sheet:
- Hide toolbar buttons
- Set defaults for replacement form
- Auto close option
- Option to disable prompt when using the delete button

0.9.2.1 Beta 5/1/2008
* Fixed bug where replacement would always be made with the first song in the new songs list
* Added ability to replace all songs with the same song
* Improved confirmation message
* Added post-replacement message
* Changed replacement process so songs can be replaced more than once in different playlists

0.9.1.2 Beta 4/30/2008
* Changed how artists, albums and songs are queried in order to support multi-artist songs
* Added "ALL" option to Album dropdown

0.9.1 Beta 4/30/2008
* Beta release of Playlist Song Replacer

Top