Hi, can you add an artist index option like twonky media server? The full artist list is not convenient with a large db.
Eg:
Artist Index ->
A B C D E F ...... ->
Celine Dion - Coolio - Cyborg .... ->
Gangsters Paradise - ...
Feature request: Artist & Title Index
Re: Feature request: Artist & Title Index
May be in future versions.cgeorgakopoulos wrote:Hi, can you add an artist index option like twonky media server? The full artist list is not convenient with a large db.
Eg:
Artist Index ->
A B C D E F ...... ->
Celine Dion - Coolio - Cyborg .... ->
Gangsters Paradise - ...
Now you can create Artist Index folder Playlists:
1. Settings - Processing - Add
2. Name: Artist Index
3. Language: PascalScript
4. Expression
Code: Select all
function GetProperty(aItem: TWmsScriptMediaItem; aPropertyID: Integer): string;
begin
Result := VarToStr(aItem.Properties[aPropertyID]);
if Result = '' then
Result := 'Unknown'
end;
procedure ProcessItem(aItem: TWmsScriptMediaItem);
var
i: Integer;
sCollectionPath, sDirectory: string;
begin
sCollectionPath := 'Artist Index\' + Copy(GetProperty(aItem, mpiAuthor), 1, 1) + '\' +
GetProperty(aItem, mpiAuthor) + '\' + GetProperty(aItem, mpiAlbum);
WmsDatabaseAddLink(mfAudioPlaylistsItemID, sCollectionPath, aItem);
end;
var
i: Integer;
MediaItemList: TWmsScriptMediaItemList;
begin
MediaItemList := WmsCurrentMediaListItems;
try
if MediaItemList.Count > 0 then begin
WmsShowProgress('Create Artist Index...');
try
for i := 0 to MediaItemList.Count - 1 do begin
if WmsCancelPressed then
Break
else begin
ProcessItem(MediaItemList[i]);
WmsSetProgress(Round(((i + 1) / MediaItemList.Count) * 100))
end
end
finally
WmsHideProgress
end;
if WmsCancelPressed then
MessageDlg('Create Artist Index interrupted by the user.', mtError, mbOK, 0)
else
MessageDlg('Create Artist Index was successful.', mtInformation, mbOK, 0)
end else
MessageDlg('No files to process.', mtError, mbOK, 0)
finally
MediaItemList.Free
end;
WmsDatabaseAutoSave;
ProcessMediaResult := True
end.
6. OK-OK-OK
7. Activate folder "All music"
8. Press button "Artist Index"
9. In folder "Playlists" must create Artist Index.
-
- Posts: 4
- Joined: Sun Dec 13, 2009 5:46 pm
Re: Feature request: Artist & Title Index
I love you!
I need to modified a little bit, I'll post when I'm done.
Happy new year!
I need to modified a little bit, I'll post when I'm done.
Happy new year!
-
- Posts: 4
- Joined: Sun Dec 13, 2009 5:46 pm
Re: Feature request: Artist & Title Index
I made a song index too (in basicScript, I'm a VB guy):
Code: Select all
Function GetProperty(Item As TWmsScriptMediaItem, PropertyID As Integer) As String
Dim PropertyValue As String = VarToStr(Item.Properties(PropertyID))
If PropertyValue = "" Then
PropertyValue = "Unknown"
End If
Return PropertyValue
End function
Sub ProcessItem(Item as TWmsScriptMediaItem)
Dim SongName As String = GetProperty(Item, mpiTitle)
Dim CollectionPath as String = "Song Index\" & Copy(SongName, 1, 1)
WmsDatabaseAddLink(mfAudioPlaylistsItemID, CollectionPath, Item)
End Sub
Dim MediaItemList as TWmsScriptMediaItemList = WmsCurrentMediaListItems
Dim ItemIndex As Integer
try
For ItemIndex = 0 To MediaItemList.Count - 1
ProcessItem(MediaItemList[ItemIndex])
Next
finally
MediaItemList.Free
End Try
WmsDatabaseAutoSave
ProcessMediaResult = True
Re: Feature request: Artist & Title Index
Perfectly, successes, good luck in New year 

Re: Feature request: Artist & Title Index
Tried these scripts ....
Artist Index created a playlist with index, but I got several errors (see attachment) so I think I have to check my MP3 tags, do a rescan of the Media files and try again
Song Index does nothing here .... no new playlist created
Since I am no programmer I just executed what I copied here, no idea where to look for errors
Artist Index created a playlist with index, but I got several errors (see attachment) so I think I have to check my MP3 tags, do a rescan of the Media files and try again
Song Index does nothing here .... no new playlist created
Since I am no programmer I just executed what I copied here, no idea where to look for errors

- Attachments
-
- wms.JPG (124.96 KiB) Viewed 17839 times
Re: Feature request: Artist & Title Index
Oops ... too quick
Song Index DID do something, I now have a new playlist, but ..... not what I thought it would do. It created a songlist based on the filename I think, see for yourself in the attachment.
How can I correct this script?

Song Index DID do something, I now have a new playlist, but ..... not what I thought it would do. It created a songlist based on the filename I think, see for yourself in the attachment.
How can I correct this script?
- Attachments
-
- wms2.JPG (245.35 KiB) Viewed 17837 times
Re: Feature request: Artist & Title Index
There is a problem reading UNICODE-tags when scanning media resources, will be fixed in next version.LouisXIV wrote:Oops ... too quick![]()
Song Index DID do something, I now have a new playlist, but ..... not what I thought it would do. It created a songlist based on the filename I think, see for yourself in the attachment.
How can I correct this script?
In what direction do you want to change the scripts?
Re: Feature request: Artist & Title Index
The UNICODE problem will be the problem with the "Artist index" script I guess, so there is indeed nothing for me to do than check my tags and wait for the next release.
The "Song index" script however seems to index my songs based on the filename (Eagles - Desperado - 01 - Doolin-Dalton.mp3 -> shows up under the E) instead of the trackname, in this case Doolin-Dalton should show up under the D
The "Song index" script however seems to index my songs based on the filename (Eagles - Desperado - 01 - Doolin-Dalton.mp3 -> shows up under the E) instead of the trackname, in this case Doolin-Dalton should show up under the D
Re: Feature request: Artist & Title Index
Try changing ProcessItemLouisXIV wrote:The UNICODE problem will be the problem with the "Artist index" script I guess, so there is indeed nothing for me to do than check my tags and wait for the next release.
The "Song index" script however seems to index my songs based on the filename (Eagles - Desperado - 01 - Doolin-Dalton.mp3 -> shows up under the E) instead of the trackname, in this case Doolin-Dalton should show up under the D
Code: Select all
Sub ProcessItem(Item as TWmsScriptMediaItem)
Dim SongName As String = GetProperty(Item, mpiTitle)
Dim DelimPos = EndPos(SongName, " - ")
If DelimPos > 0 Then
SongName = Copy(SongName, DelimPos + 3, 2000)
End If
Dim CollectionPath as String = "Song Index\" & Copy(SongName, 1, 1)
WmsDatabaseAddLink(mfAudioPlaylistsItemID, CollectionPath, Item)
End Sub