Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: create random numbers using title formatting (Read 1676 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

create random numbers using title formatting

Hi there,

is there any possibility to create random numbers using the title formatting or is there any component for that? I just switched to the HTPC skin of ojdo and what i recognized is that the album art is used from the entries in Preferences -> Display -> Album art. But for me it's a bit annoying to have the same picture all the time and there are a lot of good pictures for some artists. So i wanted to create an entry like artist_$rand(10).jpg but i didn't see anything in the title formatting reference that creates a random number.

Anything possibly?!

Regards

create random numbers using title formatting

Reply #1
http://wiki.hydrogenaudio.org/index.php?ti...e#.24rand.28.29

Quote
Generates a random number in the range from 0 to 232-1. Available only in sort-related contexts, such as the Edit → Sort → Sort by ... menu command.

C.
PC = TAK + LossyWAV  ::  Portable = Opus (130)

create random numbers using title formatting

Reply #2
Well that might work in the sorting columns, but I don't need to sort anything.

create random numbers using title formatting

Reply #3
Well that might work in the sorting columns, but I don't need to sort anything.

If you use playback statistics (play_count, first_played, last_played) you might experiment with these fields for feeding them to $crc32 like this:

Code: [Select]
//Generates pseudo-random numbers from 0 to 10-1=9
$mod($crc32(%artist% %album% %title% %last_played%),10)


This way, every time you play the same track, the number changes.

 

create random numbers using title formatting

Reply #4
Works like a charm! Thanks for that!