Author Topic: Artist separation (repeat rules) - Bug?  (Read 27675 times)

Marius

  • Administrator
  • Hero Member

  • Offline
  • *****
  • 5744
    • Radio DJ
Re: Artist separation (repeat rules) - Bug?
« Reply #45 on: July 08, 2014, 01:03:05 PM »
Just replace the exe with the new one and add the txt file.
If you already downloaded the file, please delete it and download this: http://radiodj.ro/tests/RadioDJTest2.zip
It's more optimized.
DOWNLOADS PAGE

HOW TO FIX RADIODJ DATABASE
----------------
Please don't PM me for support requests. Use the forums instead.

HMC

  • Full Member

  • Offline
  • ***
  • 181
Re: Artist separation (repeat rules) - Bug?
« Reply #46 on: July 08, 2014, 01:16:01 PM »
The 2nd zip doesn't have the program. Just a config file. Also at first glance the playlist is listing songs incorrectly now with the test RDJ.

It choose 3 songs and the 2nd and 3rd song was the same.
Radio DJ 1.7.5 Update with MariaDB 10

AndyDeGroo

  • Guest
Re: Artist separation (repeat rules) - Bug?
« Reply #47 on: July 08, 2014, 02:06:29 PM »
Ok, i think that i found a workaround also to the second check, but i will need some testing.
The modified RadioDJ.exe can be downloaded from here: http://radiodj.ro/tests/RadioDJTest.zip
The archive also has a .txt file which contains the artist separators. Put both files in RadioDJ folder.

I'd like to test it, but first file "RadioDJTest.zip" is no longer available and second one doesn't contain RadioDJ.exe.

Marius

  • Administrator
  • Hero Member

  • Offline
  • *****
  • 5744
    • Radio DJ
Re: Artist separation (repeat rules) - Bug?
« Reply #48 on: July 08, 2014, 02:40:20 PM »
Sorry for that, i corrected the archive.
DOWNLOADS PAGE

HOW TO FIX RADIODJ DATABASE
----------------
Please don't PM me for support requests. Use the forums instead.

HMC

  • Full Member

  • Offline
  • ***
  • 181
Re: Artist separation (repeat rules) - Bug?
« Reply #49 on: July 08, 2014, 03:18:47 PM »
Ok I got the 2nd test. I'll have to test it this evening. Can't play right now. LOL. I'll report back what I find.
Radio DJ 1.7.5 Update with MariaDB 10

AndyDeGroo

  • Guest
Re: Artist separation (repeat rules) - Bug?
« Reply #50 on: July 08, 2014, 04:36:20 PM »
I tried to replace the RadioDJ.exe, but it was locked by svchost.exe as DLL handle even after exiting RDJ. The svchost.exe process is running local network restricted services an one of them is EventLog service. After restarting the EventLog service handle was released and I could replace RadioDJ.exe.
This must be related to my fiddling with registry keys for Event Log entries from RadioDJ. I wrote about that issue here. Somehow I didn't receive any satisfying answer to my questions.

AndyDeGroo

  • Guest
Re: Artist separation (repeat rules) - Bug?
« Reply #51 on: July 08, 2014, 05:08:50 PM »
I'm testing it now and it appears to be selecting same artist and even same track for queue.

Here is data from my queue after clearing and allowing to load new tracks:
Code: [Select]
The xx - Basic Space
The xx - Missing
Arcade Fire - Afterlife
Kings Of Leon - Manhattan
Florence + the Machine - Bird Song
The xx - Missing
5nizza - Я Тебя Вы...
Darwin Deez - Radar Detector
!!! - Wannagain Wannagain
Kings Of Leon - 17
Kings Of Leon - Camaro
Adele - Hometown Glory
Florence + the Machine - Bird Song
5nizza - Пятница
Kings Of Leon - Camaro
Florence + the Machine - Bird Song
Foster The People - Pumped Up Kicks (Bridge & Law Remix)
Dirty Projectors + Bjork - All We Are
Something is no right here.

Marius

  • Administrator
  • Hero Member

  • Offline
  • *****
  • 5744
    • Radio DJ
Re: Artist separation (repeat rules) - Bug?
« Reply #52 on: July 08, 2014, 05:17:04 PM »
About the logs, i use .NET way to write them (exactly like in the documentation: http://msdn.microsoft.com/en-us/library/xzwc042w%28v=vs.110%29.aspx) On some systems are required admin privileges to read/write them, maybe it's also your case, i really cannot say yet.

About the second issue, can you please check if your songs table has these 2 columns: "tdate_played" and "tartist_played"?
DOWNLOADS PAGE

HOW TO FIX RADIODJ DATABASE
----------------
Please don't PM me for support requests. Use the forums instead.

AndyDeGroo

  • Guest
Re: Artist separation (repeat rules) - Bug?
« Reply #53 on: July 08, 2014, 05:29:54 PM »
About the logs, i use .NET way to write them (exactly like in the documentation: http://msdn.microsoft.com/en-us/library/xzwc042w%28v=vs.110%29.aspx) On some systems are required admin privileges to read/write them, maybe it's also your case, i really cannot say yet.
After adding mentioned registry keys, the messages appear in event logs. Only problem is that they have following text before actual message:
Code: [Select]
The description for Event ID 0 from source RadioDJ cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.

If the event originated on another computer, the display information had to be saved with the event.

The following information was included with the event:
I'm not sure if I really had to set EventMessageFile to full path of RadioDJ.exe.

About the second issue, can you please check if your songs table has these 2 columns: "tdate_played" and "tartist_played"?
Yes, they are the last two columns. tartist_played gets updated but tdate_played does not. How and why does RDJ use those columns?

AndyDeGroo

  • Guest
Re: Artist separation (repeat rules) - Bug?
« Reply #54 on: July 08, 2014, 07:58:36 PM »
I'm looking at MySQL general-log and I can see that `queuelist` is completely ignored when selecting songs for queue. In logfile from RadioDJ 1.6.5.7 there is LEFT JOIN `queuelist` to skip songs that are already in queue.

There is one thing that I don't understand and wanted to ask; Why RDJ does TRUNCATE `queuelist`; before inserting each track and then again inserts every track that is in queue? IMO, it is faster to just delete the track that is starting to play and keep the table populated. That would lead to less strain on database and better performance.

Update: I forgot to mention that featured artists are updated as expected. For "King Fantastic feat. AWOLNATION" RDJ does these queries:
Code: [Select]
UPDATE `songs` SET `artist_played`=NOW() WHERE `artist` LIKE '%King Fantastic%';
UPDATE `songs` SET `artist_played`=NOW() WHERE `artist` LIKE '%AWOLNATION%'


Marius

  • Administrator
  • Hero Member

  • Offline
  • *****
  • 5744
    • Radio DJ
Re: Artist separation (repeat rules) - Bug?
« Reply #55 on: July 09, 2014, 12:43:03 PM »
I will try to answer to your questions:

- The only reason why i need the queue table is to avoid to select duplicates when i generate the playlist from the rotation and i need an exact copy of the playlist that i have in the memory.
It's not only about deleting the playing track, but when a track is inserted to a specific position in the playlist, or they are drag & dropped, it would be far more complicated to reorder them in the queue table than truncate the table and then inserting a fresh copy of the playlist.

In order to sync them i would need to use more delete/insert commands on the table and as far as i know TRUNCATE is faster because  it doesn't keep any logs.

- For this test i tried another method to avoid duplicates and to be honest i don't understand why here is working flawlessly and there not. If i use the LEFT JOIN i can only exclude artists that are named exactly the same, which makes our existing featured artist separation method inefficient. Like i said before the featured artists are marked as played only when the track is actually played.

But what happens when the track is not played yet. Let's say that the first artist from the playlist is "Pitbull f. Danny Mercer" and the Auto DJ needs to add more tracks. If it will use the existing LEFT JOIN to see if the artist it's already in the queue table "Pitbull f. G.R.L." will be a valid result because this exact artist is not found, so we will end up with a duplicate artist.

So i tried a different approach and i removed the join and each time when i select a track, i split the featured artists and i update the "tartist_played" with the current date and time and when i select a new track i order the results also by the "tartist_played" ASC.

Maybe it's not the best method, but that's why i said that it's a test...

PS: Do you have rotation entries without repeat rules unchecked beside jingles?
DOWNLOADS PAGE

HOW TO FIX RADIODJ DATABASE
----------------
Please don't PM me for support requests. Use the forums instead.

HMC

  • Full Member

  • Offline
  • ***
  • 181
Re: Artist separation (repeat rules) - Bug?
« Reply #56 on: July 09, 2014, 06:37:57 PM »
I had similar results where the playlist was duplicating songs. Like the same two songs. It was kinda weird.

e.g.

Artist 1 - song 1
Artist 2 - song 2
Artist 1 - song 1
Artist 1 - song 1
Artist 2 - song 2
Radio DJ 1.7.5 Update with MariaDB 10

Marius

  • Administrator
  • Hero Member

  • Offline
  • *****
  • 5744
    • Radio DJ
Re: Artist separation (repeat rules) - Bug?
« Reply #57 on: July 09, 2014, 07:16:10 PM »
Ok, so this test failed for now. I'm still open to a better solution.
DOWNLOADS PAGE

HOW TO FIX RADIODJ DATABASE
----------------
Please don't PM me for support requests. Use the forums instead.

AndyDeGroo

  • Guest
Re: Artist separation (repeat rules) - Bug?
« Reply #58 on: July 10, 2014, 01:57:01 PM »
- The only reason why i need the queue table is to avoid to select duplicates when i generate the playlist from the rotation and i need an exact copy of the playlist that i have in the memory.
It's not only about deleting the playing track, but when a track is inserted to a specific position in the playlist, or they are drag & dropped, it would be far more complicated to reorder them in the queue table than truncate the table and then inserting a fresh copy of the playlist.

In order to sync them i would need to use more delete/insert commands on the table and as far as i know TRUNCATE is faster because  it doesn't keep any logs.
IIRIC, you already answered same question in PM. Yes, TRUNCATE is faster than DELETE.
Drag & drop sorting could be done by adding indexed sorting column on queuelist and then updating that when needed, but that would take some major changes in how RDJ handles queue. If RDJ maintained a queue in database, we could have queue which could be modified form outside.

So i tried a different approach and i removed the join and each time when i select a track, i split the featured artists and i update the "tartist_played" with the current date and time and when i select a new track i order the results also by the "tartist_played" ASC.

PS: Do you have rotation entries without repeat rules unchecked beside jingles?

I have 9 rotation entries set to "Least Recently Played", "Least Times Played" and "By Priority" and all have repeat rules enabled.
The approach doesn't work because `tartist_played` is second field in ORDER BY clause and the field is reset to identical values for same artist every time one is selected. To check this I tried following query for "Least Recently Played":
Code: [Select]
SELECT `songs`.`ID`, `songs`.`artist` FROM `songs`
WHERE `songs`.`enabled`=1 AND `id_subcat`=4
AND ((`start_date` <= Now()) AND (`end_date` >= NOW() OR `end_date` = '2002-01-01 00:00:01'))
AND (TIMESTAMPDIFF(MINUTE, `date_played`, NOW())>240 AND TIMESTAMPDIFF(MINUTE, `artist_played`, NOW())>240)
ORDER BY `date_played` ASC, `tartist_played` ASC, RAND() LIMIT 1
After trying to run select and update (with WHERE `artist` LIKE '%artist%'`) several time, select query is stuck between 3 artists on subsequent selects. Until `date_played` is updated, they get selected again and again depending on `date_played`.

For intended effect another part should be added to where clause:
Code: [Select]
AND TIMESTAMPDIFF(MINUTE, `tartist_played`, NOW())>240

I checked and it works.

Marius

  • Administrator
  • Hero Member

  • Offline
  • *****
  • 5744
    • Radio DJ
Re: Artist separation (repeat rules) - Bug?
« Reply #59 on: July 10, 2014, 02:29:36 PM »
Quote
AND TIMESTAMPDIFF(MINUTE, `tartist_played`, NOW())>240

If i would do this and the user switches on the autodj and then for a reason or another clears the playlist for that amount of time those tracks will not be played again. Even now, you see how many users think that they have enough tracks to support a long repeat intervals, but adding also this, could reduce dramatically the amount of autodj results.

We need something better...  :)

PS: in the first versions i kept the queue in the database, but is slow for small tracks when the changes are too quick and also the memory version of queue is holding much more data (cue points calculated in bytes and in seconds, the fades etc), all this so when a track is starting to spend less time to compute everything.
DOWNLOADS PAGE

HOW TO FIX RADIODJ DATABASE
----------------
Please don't PM me for support requests. Use the forums instead.