Author Topic: Is it possible with the request plugin to list only specific tracks?  (Read 8207 times)

baba

  • New User

  • Offline
  • *
  • 18
    • Babaganousha Radio [[ Stream Your Dream ]]
Hello,

I recently added the request feature to my radio. But i got really a lot of tracks,
so it would be great to limit the list of tracks to let's say  "Psytrance from 2003"
or similar.... like an SQL ....

Any help is appreciated.

Thank you to all developers of Radio DJ and the Plugins  :)!

I found it out  :)

First you have to find the numerical values of your subcategories:

Code: [Select]

mysql -u root -p
Enter password:
****

use radiodj;  (or whatever your db is named)
MariaDB [radiodj]> show t
+-------------------+
| Tables_in_radiodj |
+-------------------+
| carts             |
| carts_list        |
| category          |
| events            |
| events_categories |
| genre             |
| history           |
| playlists         |
| playlists_list    |
| queuelist         |
| requests          |
| rotations         |
| rotations_list    |
| songs             |
| subcategory       |
+-------------------+
15 rows in set (0.00 sec)

MariaDB [radiodj]> select * from subcate
+----+----------+----------------------+
| ID | parentid | name                 |
+----+----------+----------------------+
|  1 |        1 | 90s                  |
|  2 |        1 | 80s                  |
|  4 |        1 | 2000s                |
|  5 |        1 | Heavy Rotation       |
|  7 |        2 | Contest Effects      |
|  8 |        3 | Daily Sweepers       |
|  9 |        3 | Nightly Sweepers     |
| 10 |        4 | Artist IDs           |
| 11 |        5 | Station Jingles      |
| 12 |        6 | Radio Show Promos    |
| 13 |        7 | Sponsor Commercials  |
| 14 |        7 | Paid Commercials     |
| 15 |        8 | Daily News           |
| 16 |        9 | Music Interviews     |
| 17 |        9 | Political Interviews |
| 18 |       10 | My First Show        |
| 19 |       10 | My Second Show       |
| 20 |       11 | Other                |
| 21 |       11 | Syndicated Shows     |
| 22 |       11 | Syndicated News      |
| 30 |        1 | 19xx                 |
| 31 |        1 | 2000                 |
| 32 |        1 | 2001                 |
| 33 |        1 | 2002                 |
| 34 |        1 | 2003                 |
| 35 |        1 | 2004                 |
----------------------------------------



Okay now we know the numerical values. We have to change the request.php

Code: [Select]
81 //============ END FUNCTIONS ==============//
 82
 83 $srch = "";   //search term value holder
 84 $srchpath = ""; //search path holder
 85 $srcquery = "AND id_subcat BETWEEN 30 and 33"; //search query holder
 86 $stages = 3;  //how to split the pagination
 87 $page = 1;    //default page
 88 $reqid = "";


This way i was able to narrow the categories.
Proud user of RadioDJ Free Radio Automation Software.
========================================

http://babaganousha.net
Psytrance & Goa 24/7 - Stream Your Dream

Yvette - Hitz24

  • Full Member

  • Offline
  • ***
  • 213
  • Personal Text
    The Hits Only Station
    • Hitz24
Re: Is it possible with the request plugin to list only specific tracks?
« Reply #1 on: November 27, 2015, 01:33:09 PM »
This very clear, but how to exclude 2 or 3 categories in MySQL, for instance, When we want to exclude subcategories 68, 32 and 33.
How do we do that?

Yvette
Streaming Hit Music

Jhonny

  • Hero Member

  • Offline
  • *****
  • 3989
  • Personal Text
    Peace, enjoy life, last sleep is longer than live!
    • Jhonny's RadioDJ tutorials.
Re: Is it possible with the request plugin to list only specific tracks?
« Reply #2 on: November 27, 2015, 02:01:08 PM »
With a NOT IN.

NOT IN(68,32,33)
R.T.F.M. means to me, Read The Fantastic Messages.
Einstein says: Make things simple, but don't make simple things simpler! (wise) this is just my life lesson you know.

I don't do drugs, I do tuts. ( ͡° ͜ʖ ͡°) visit  https://radiodj.info

Testing RadioDJ v2.0.2.0 Beta

Valdis

  • Hero Member

  • Offline
  • *****
  • 562
  • Personal Text
    Radio is a mental condition
    • home
Re: Is it possible with the request plugin to list only specific tracks?
« Reply #3 on: November 27, 2015, 02:42:58 PM »
With a NOT IN.

NOT IN(68,32,33)

Yes, this is the correct way to filter multiple values.
I am, therefore I think.
I design and develop web apps, and have created few RadioDJ plugins - https://axellence.lv/downloads/

Yvette - Hitz24

  • Full Member

  • Offline
  • ***
  • 213
  • Personal Text
    The Hits Only Station
    • Hitz24
Re: Is it possible with the request plugin to list only specific tracks?
« Reply #4 on: November 27, 2015, 06:56:51 PM »
So you mean:

85 $srcquery = "AND id_subcat NOT IN(68,32,33)"; //search query holder

If I understand correctly?

Yvette
Streaming Hit Music

Jhonny

  • Hero Member

  • Offline
  • *****
  • 3989
  • Personal Text
    Peace, enjoy life, last sleep is longer than live!
    • Jhonny's RadioDJ tutorials.
Re: Is it possible with the request plugin to list only specific tracks?
« Reply #5 on: November 27, 2015, 07:58:17 PM »
More like:

$srcquery = "AND id_subcat BETWEEN 31 and 69 NOT IN(68,32,33) ";
R.T.F.M. means to me, Read The Fantastic Messages.
Einstein says: Make things simple, but don't make simple things simpler! (wise) this is just my life lesson you know.

I don't do drugs, I do tuts. ( ͡° ͜ʖ ͡°) visit  https://radiodj.info

Testing RadioDJ v2.0.2.0 Beta

Yvette - Hitz24

  • Full Member

  • Offline
  • ***
  • 213
  • Personal Text
    The Hits Only Station
    • Hitz24
Re: Is it possible with the request plugin to list only specific tracks?
« Reply #6 on: November 27, 2015, 08:08:51 PM »
Ok,

I think I understand, but for me all subcats are valid, except 68, 32 and 33.

So I wonder, does the following work for me?

$srcquery = "NOT IN(68,32,33) ";
Streaming Hit Music

Jhonny

  • Hero Member

  • Offline
  • *****
  • 3989
  • Personal Text
    Peace, enjoy life, last sleep is longer than live!
    • Jhonny's RadioDJ tutorials.
Re: Is it possible with the request plugin to list only specific tracks?
« Reply #7 on: November 28, 2015, 06:17:58 PM »
Could be..

I do like to see the total code, if posseble!

So we know what it all is about.

It's the most about logic in programming, i know.

Can't find it in the start of the topic.

Now we write only about commands.

if I missed it, sorry for that.

PS. I learned a lot from www.w3schools.com.
R.T.F.M. means to me, Read The Fantastic Messages.
Einstein says: Make things simple, but don't make simple things simpler! (wise) this is just my life lesson you know.

I don't do drugs, I do tuts. ( ͡° ͜ʖ ͡°) visit  https://radiodj.info

Testing RadioDJ v2.0.2.0 Beta

Jhonny

  • Hero Member

  • Offline
  • *****
  • 3989
  • Personal Text
    Peace, enjoy life, last sleep is longer than live!
    • Jhonny's RadioDJ tutorials.
Re: Is it possible with the request plugin to list only specific tracks?
« Reply #8 on: November 28, 2015, 07:01:58 PM »
Just as a supplement.

I find in the file request.php the string back four times.

Like:

Line 85, $srcquery = ""; //search query holder

Line 95, $srcquery = "AND (`artist` LIKE '%$srch%' OR `title` LIKE '%$srch%')"; //Search artist and title

Line 234, $query = "SELECT COUNT(*) as num FROM `songs` WHERE `enabled`='1' $srcquery AND `song_type`=0";

Line 239, $query1 = "SELECT `ID`, `artist`, `title`, `duration`, `date_played`, `artist_played` FROM `songs` WHERE `enabled`='1' $srcquery AND`song_type`=0 ORDER BY `artist` ASC LIMIT $start, $limit";
R.T.F.M. means to me, Read The Fantastic Messages.
Einstein says: Make things simple, but don't make simple things simpler! (wise) this is just my life lesson you know.

I don't do drugs, I do tuts. ( ͡° ͜ʖ ͡°) visit  https://radiodj.info

Testing RadioDJ v2.0.2.0 Beta

Jhonny

  • Hero Member

  • Offline
  • *****
  • 3989
  • Personal Text
    Peace, enjoy life, last sleep is longer than live!
    • Jhonny's RadioDJ tutorials.
Re: Is it possible with the request plugin to list only specific tracks?
« Reply #9 on: November 28, 2015, 07:24:48 PM »
Maybe I am of topic, but I think that line 85 you put in, is overwritten by line 95.

perhaps that the actual programmers, can say, you're wrong.
R.T.F.M. means to me, Read The Fantastic Messages.
Einstein says: Make things simple, but don't make simple things simpler! (wise) this is just my life lesson you know.

I don't do drugs, I do tuts. ( ͡° ͜ʖ ͡°) visit  https://radiodj.info

Testing RadioDJ v2.0.2.0 Beta

Yvette - Hitz24

  • Full Member

  • Offline
  • ***
  • 213
  • Personal Text
    The Hits Only Station
    • Hitz24
Re: Is it possible with the request plugin to list only specific tracks?
« Reply #10 on: November 28, 2015, 07:28:36 PM »
Hi,

I think it involves line 85.
In this line the script is handling the subcats which are to be displayed on the request page on the station's website.
Is that correct?

Yvette
Streaming Hit Music

Jhonny

  • Hero Member

  • Offline
  • *****
  • 3989
  • Personal Text
    Peace, enjoy life, last sleep is longer than live!
    • Jhonny's RadioDJ tutorials.
Re: Is it possible with the request plugin to list only specific tracks?
« Reply #11 on: November 28, 2015, 07:32:06 PM »
Yes, but I think that line 95 overwrites it.

R.T.F.M. means to me, Read The Fantastic Messages.
Einstein says: Make things simple, but don't make simple things simpler! (wise) this is just my life lesson you know.

I don't do drugs, I do tuts. ( ͡° ͜ʖ ͡°) visit  https://radiodj.info

Testing RadioDJ v2.0.2.0 Beta

Jhonny

  • Hero Member

  • Offline
  • *****
  • 3989
  • Personal Text
    Peace, enjoy life, last sleep is longer than live!
    • Jhonny's RadioDJ tutorials.
Re: Is it possible with the request plugin to list only specific tracks?
« Reply #12 on: November 28, 2015, 07:34:16 PM »
Quote
Hi,

I think it involves line 85.
In this line the script is handling the subcats which are to be displayed on the request page on the station's website.
Is that correct?

Yvette

But by testing it, you can find out.
R.T.F.M. means to me, Read The Fantastic Messages.
Einstein says: Make things simple, but don't make simple things simpler! (wise) this is just my life lesson you know.

I don't do drugs, I do tuts. ( ͡° ͜ʖ ͡°) visit  https://radiodj.info

Testing RadioDJ v2.0.2.0 Beta

Yvette - Hitz24

  • Full Member

  • Offline
  • ***
  • 213
  • Personal Text
    The Hits Only Station
    • Hitz24
Re: Is it possible with the request plugin to list only specific tracks?
« Reply #13 on: March 01, 2016, 09:28:20 PM »
Finally tested it.

This seems to work:

LINE 85 $srcquery = "AND id_subcat NOT IN(33)"; //search query holder

LINE 95 $srcquery = "AND (`artist` LIKE '%$srch%' OR `title` LIKE '%$srch%') AND id_subcat NOT IN(33)"; //Search artist and title

(For those who don't know how to get the subcategory number of the subcategory to be excluded: Go in Events, and add Track from Category. Choose the subcat you want to exclude. Add and you see a line like: Load Track From Category|0|33|0|0|1|False.......etc..
The second number (33) is the subcat number. )
Maybe there is another way, but this works for me.

So now we can exclude Christmas songs from being requested in the non-Chrstmas weeks of the year.

Thanks for the help guys!

Yvette
Streaming Hit Music

marcbeinder

  • Sr. Member

  • Offline
  • ****
  • 330
    • Rise! FM - St. Louis
Re: Is it possible with the request plugin to list only specific tracks?
« Reply #14 on: March 06, 2016, 12:46:22 AM »
Is there a way to hide more than one subcategory?
RiseRadio.org // EncoreMediaSystems.com