Author Topic: [SOLVED] Rotation from Genre?  (Read 176 times)

unpetru

  • Full Member

  • Offline
  • ***
  • 113
    • Lounge Avenue Radio
[SOLVED] Rotation from Genre?
« on: October 09, 2018, 10:57:05 AM »
Hi guys,

I want to make a rotation dedicated to one genre, a thematic show. But when setting up the rotation, i can choose the genre from a subcategory. I can't choose Music - All subcategories - Genre X. I have to set up a subcategory and then the genre, but that genre is in different subcategories, so how can I make that rotation?

A workaround I thought about is placing in the rotation all subcategories with Genre X, but that's not the right way to do it, in my mind...

Thanks.
Lounge Avenue (Chillout Radio)
http://lounge-avenue.com

Calypso

  • Full Member

  • Offline
  • ***
  • 222
Re: Rotation from Genre?
« Reply #1 on: October 09, 2018, 11:13:46 AM »
I want to make a rotation dedicated to one genre, a thematic show. But when setting up the rotation, i can choose the genre from a subcategory. I can't choose Music - All subcategories - Genre X. I have to set up a subcategory and then the genre, but that genre is in different subcategories, so how can I make that rotation?

A workaround I thought about is placing in the rotation all subcategories with Genre X, but that's not the right way to do it, in my mind...

Make your rotation based on an SQL query.

For example:

SELECT songs.ID as ID FROM songs LEFT JOIN `queuelist` ON (`songs`.`ID` = `queuelist`.`songID` OR `songs`.`artist` = `queuelist`.`artist`) WHERE songs.enabled=1 AND songs.id_genre=[genreid] AND (`queuelist`.`songID` IS NULL OR `queuelist`.`artist` IS NULL) AND $ForceRepeatRules$ ORDER BY RAND() LIMIT 1;



unpetru

  • Full Member

  • Offline
  • ***
  • 113
    • Lounge Avenue Radio
Re: Rotation from Genre?
« Reply #2 on: October 09, 2018, 11:26:10 AM »
Make your rotation based on an SQL query.

For example:

SELECT songs.ID as ID FROM songs LEFT JOIN `queuelist` ON (`songs`.`ID` = `queuelist`.`songID` OR `songs`.`artist` = `queuelist`.`artist`) WHERE songs.enabled=1 AND songs.id_genre=[genreid] AND (`queuelist`.`songID` IS NULL OR `queuelist`.`artist` IS NULL) AND $ForceRepeatRules$ ORDER BY RAND() LIMIT 1;

I have no idea how to edit this because I didn't understand anything. :)))
Lounge Avenue (Chillout Radio)
http://lounge-avenue.com

unpetru

  • Full Member

  • Offline
  • ***
  • 113
    • Lounge Avenue Radio
Re: Rotation from Genre?
« Reply #3 on: October 09, 2018, 01:27:26 PM »
Make your rotation based on an SQL query.

For example:

SELECT songs.ID as ID FROM songs LEFT JOIN `queuelist` ON (`songs`.`ID` = `queuelist`.`songID` OR `songs`.`artist` = `queuelist`.`artist`) WHERE songs.enabled=1 AND songs.id_genre=[genreid] AND (`queuelist`.`songID` IS NULL OR `queuelist`.`artist` IS NULL) AND $ForceRepeatRules$ ORDER BY RAND() LIMIT 1;

I saved the code as an .sql after I completed the genre id from my db. I tried to run the query in RDJ's events but didn't work. Also, I need to place sweepers and jingles, and all of them automaticaly... If there isn't a good way to do it, I will place these songs in a subcategory but I prefer not to do it this way.
Lounge Avenue (Chillout Radio)
http://lounge-avenue.com

Calypso

  • Full Member

  • Offline
  • ***
  • 222
Re: Rotation from Genre?
« Reply #4 on: October 09, 2018, 03:12:08 PM »
I have no idea how to edit this because I didn't understand anything. :)))

I think the page of DJ GaryBaldy is a good starting point:

https://djgarybaldy.co.uk/radiodj-track-rotations/

Look at "Tracks from SQL Query" and list your genres. There you will find the genre ID that you need to fill in on [genreid] in my query. The example shows how to use and test "your" query, so you can use it into a rotation. If you have additional requirements for you query (like also making a pattern in subcategories) you can extend the query, but the one I've given you is a good starting point I guess.


unpetru

  • Full Member

  • Offline
  • ***
  • 113
    • Lounge Avenue Radio
Re: Rotation from Genre?
« Reply #5 on: October 09, 2018, 03:17:36 PM »
I tried it but doesn't work in events - query.
Lounge Avenue (Chillout Radio)
http://lounge-avenue.com

Calypso

  • Full Member

  • Offline
  • ***
  • 222
Re: Rotation from Genre?
« Reply #6 on: October 09, 2018, 05:52:21 PM »
I tried it but doesn't work in events - query.

You wanted to make a rotation for one genre. The query I gave, and the page I pointed you to, are for a rotation. Making the rotation doesn't have anything to do in "Events - Query" - that's for something completely different.

What you need to do is create a new rotation, add a new line into it and choose as the type a SQL Query.

unpetru

  • Full Member

  • Offline
  • ***
  • 113
    • Lounge Avenue Radio
Re: Rotation from Genre?
« Reply #7 on: October 09, 2018, 06:00:20 PM »
Ok. It gave me an error that no content or errors.

Code: [Select]
SELECT songs.ID as ID FROM songs LEFT JOIN `queuelist` ON (`songs`.`ID` = `queuelist`.`songID` OR `songs`.`artist` = `queuelist`.`artist`) WHERE songs.enabled=1 AND songs.id_genre=[165] AND (`queuelist`.`songID` IS NULL OR `queuelist`.`artist` IS NULL) AND ((`songs`.`start_date` <= NOW() OR `songs`.`start_date` = '2002-01-01 00:00:01')
AND (`songs`.`end_date` >= NOW() OR `songs`.`end_date` = '2002-01-01 00:00:01')
AND (TIMESTAMPDIFF(MINUTE, `songs`.`date_played`, NOW()) > 180)
AND (TIMESTAMPDIFF(MINUTE, `songs`.`title_played`, NOW()) > 120)
AND (TIMESTAMPDIFF(MINUTE, `songs`.`artist_played`, NOW()) > 120)) ORDER BY RAND() LIMIT 1;
Lounge Avenue (Chillout Radio)
http://lounge-avenue.com

Calypso

  • Full Member

  • Offline
  • ***
  • 222
Re: Rotation from Genre?
« Reply #8 on: October 09, 2018, 06:44:10 PM »
Ok. It gave me an error that no content or errors.

Code: [Select]
SELECT songs.ID as ID FROM songs LEFT JOIN `queuelist` ON (`songs`.`ID` = `queuelist`.`songID` OR `songs`.`artist` = `queuelist`.`artist`) WHERE songs.enabled=1 AND songs.id_genre=[165] AND (`queuelist`.`songID` IS NULL OR `queuelist`.`artist` IS NULL) AND ((`songs`.`start_date` <= NOW() OR `songs`.`start_date` = '2002-01-01 00:00:01')
AND (`songs`.`end_date` >= NOW() OR `songs`.`end_date` = '2002-01-01 00:00:01')
AND (TIMESTAMPDIFF(MINUTE, `songs`.`date_played`, NOW()) > 180)
AND (TIMESTAMPDIFF(MINUTE, `songs`.`title_played`, NOW()) > 120)
AND (TIMESTAMPDIFF(MINUTE, `songs`.`artist_played`, NOW()) > 120)) ORDER BY RAND() LIMIT 1;

Don't put the brackets ([]) around the genre-id 

unpetru

  • Full Member

  • Offline
  • ***
  • 113
    • Lounge Avenue Radio
Re: Rotation from Genre?
« Reply #9 on: October 09, 2018, 07:40:35 PM »
Oh, ok.

How can I set a sweeper category, tell radio dj to put a sweeper every 2 songs on Intro?
Lounge Avenue (Chillout Radio)
http://lounge-avenue.com

unpetru

  • Full Member

  • Offline
  • ***
  • 113
    • Lounge Avenue Radio
Re: Rotation from Genre?
« Reply #10 on: October 09, 2018, 07:54:04 PM »
Don't put the brackets ([]) around the genre-id

Everything is working fine. I just need to put INTRO sweepers on every 2 songs.

Thanks man.
Lounge Avenue (Chillout Radio)
http://lounge-avenue.com

unpetru

  • Full Member

  • Offline
  • ***
  • 113
    • Lounge Avenue Radio
Re: Rotation from Genre?
« Reply #11 on: October 09, 2018, 09:48:54 PM »
Got it thanks to Marius and to you, Calypso.
Lounge Avenue (Chillout Radio)
http://lounge-avenue.com

unpetru

  • Full Member

  • Offline
  • ***
  • 113
    • Lounge Avenue Radio
Re: [SOLVED] Rotation from Genre?
« Reply #12 on: October 11, 2018, 12:16:53 AM »
Catastrophic failure.

Loaded the rotation but didnt play it. So i had a two hours blank.

All my songs moved from the default genre to the specific one for the show ended back in the default genre. I cant explain this...
Lounge Avenue (Chillout Radio)
http://lounge-avenue.com

Marius

  • Administrator
  • Hero Member

  • Online
  • *****
  • 5292
    • Radio DJ Romania
Re: [SOLVED] Rotation from Genre?
« Reply #13 on: October 11, 2018, 10:01:59 AM »
When you set a genre to a track, there isn't any kind of genre history in the program that could explain how tracks got back to an earlier genre (beside restoring a database to an earlier state). You said in the mail that you are using the Folder Sync plugin, i suspect that you have there the some rules that did that, otherwise this issue has no logic.
DOWNLOADS PAGE

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

unpetru

  • Full Member

  • Offline
  • ***
  • 113
    • Lounge Avenue Radio
Re: [SOLVED] Rotation from Genre?
« Reply #14 on: October 11, 2018, 10:05:42 AM »
I think so too, even if I dont have songs from that genre in the synced folders. I disabled the automatic sync. I think the folder sync might be the only logic explanation.

I moved those songs to their own subcategory and created a special rotation for their show.

This is really interresting. :D
Lounge Avenue (Chillout Radio)
http://lounge-avenue.com