• Welcome to RadioDJ - Free Radio Automation Software Forum. Please log in or sign up.

[SOLVED] Duplicated entries in Search Results

Started by unpetru, August 06, 2018, 01:36:31 PM

Jhonny

Search on artist name Green Day has no result.

Search on Boulevard of Broken Dreams result with the artist name Green Day.

Think you have a double track with a diverent file name.

Like green day - Boulevard of Broken Dreams.mp3
and
green  day - Boulevard of Broken Dreams.mp3 a double space in the file.

Check with the trackmanager.
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 ( ͡° ͜ʖ ͡°)
The Radiodj tutorials site is now managed by Domstad radio .nl still  Just in English

unpetru

Only one track there. I didnt upload your last version of index yet.
Lounge Avenue (Chillout Radio)
http://lounge-avenue.com

DJ Garybaldy

I've updated the website template to include Jhonny's piece of SQL query

You should only need to replace index.php


http://www.mediafire.com/file/5za6ivxeat17t2g/RDJ_Template_2.0.zip/file
Worlds Biggest Fan of RadioDJ

Install MariaDB https://djgarybaldy.blogspot.com/2020/08/installing-maria-db.html

Install RadioDJ: https://djgarybaldy.blogspot.com/2020/08/how-to-install-radiodj-free-radio.html

Into Internet radio for 25 years 1999-2024

RadioDJ 2045 MariaDB 11.2 Windows 11

unpetru

It still finds disabled tracks. I searched for several disabled and found them all...
Lounge Avenue (Chillout Radio)
http://lounge-avenue.com

DJ Garybaldy

I know its not doing on artist but as for not showing the title when its disabled is puzzling me.... I can indeed search the track by title when its disabled but not by artist...  :bash:
The quest for this piece of code continues.
Worlds Biggest Fan of RadioDJ

Install MariaDB https://djgarybaldy.blogspot.com/2020/08/installing-maria-db.html

Install RadioDJ: https://djgarybaldy.blogspot.com/2020/08/how-to-install-radiodj-free-radio.html

Into Internet radio for 25 years 1999-2024

RadioDJ 2045 MariaDB 11.2 Windows 11

unpetru

I am a very good beta-tester. If you need one, just tell me.  >:D
Lounge Avenue (Chillout Radio)
http://lounge-avenue.com

Dragos

Quote from: stevewa on August 08, 2018, 03:25:36 AM
@Dragos, do you have any subcategory id's excluded (web user not allowed to make requests in those subcategories) for the query?

in your config.php file, line 20
$reqsubcat = ''; // exclude subcats use id numbers like 1,2,3  Empty for show all


if you do, the search query statement that is used in index.php, line 58, appears to be missing the OR to search the title data field.

if (!empty($reqsubcat)) {
                $srch = mysqli_real_escape_string($conn, $_GET['searchterm']);
                $srchpath = "&searchterm=$srch";
                $srcquery = "AND (`artist` LIKE '%$srch%') $notin "; //Search artist and title not in selected subcats
            } else {
                $srch = mysqli_real_escape_string($conn, $_GET['searchterm']);
                $srchpath = "&searchterm=$srch";
                $srcquery = "AND (`artist` LIKE '%$srch%') OR (`title` LIKE '%$srch%')"; //Search artist and title
            }


copy and paste the segment OR (`title` LIKE '%$srch%') right before the word $notin, see if that allows you to search by title also
That DID the trick. Now search works for titles too. Thanks so much, stevewa!
Only one issue left from my side. The one with the songs in the query that can be requested again if not played. The workaround I did for now is to restrict the next request to 4 minutes.
Radio is one of the best things that happened to the world.

DJ Garybaldy

Quote from: Dragos on August 08, 2018, 07:34:09 PM
That DID the trick. Now search works for titles too. Thanks so much, stevewa!
Only one issue left from my side. The one with the songs in the query that can be requested again if not played. The workaround I did for now is to restrict the next request to 4 minutes.
Me personally i'd restrict it to 1 every 60 minutes that way you won't get flooded with requests.
Worlds Biggest Fan of RadioDJ

Install MariaDB https://djgarybaldy.blogspot.com/2020/08/installing-maria-db.html

Install RadioDJ: https://djgarybaldy.blogspot.com/2020/08/how-to-install-radiodj-free-radio.html

Into Internet radio for 25 years 1999-2024

RadioDJ 2045 MariaDB 11.2 Windows 11

stevewa


unpetru

DJ Garybaldy, how can I set up a custom port for connecting the script to the db? For example: public port 33306 routed to intranet port 3306. The router can do that, but I don't know if I can configure the script...

The default port is susceptible to attacks.

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

DJ Garybaldy

Quote from: unpetru on August 09, 2018, 04:29:27 PM
DJ Garybaldy, how can I set up a custom port for connecting the script to the db? For example: public port 33306 routed to intranet port 3306. The router can do that, but I don't know if I can configure the script...

The default port is susceptible to attacks.

Thanks.
Will you website host allow you to use that port is a bigger question.
Worlds Biggest Fan of RadioDJ

Install MariaDB https://djgarybaldy.blogspot.com/2020/08/installing-maria-db.html

Install RadioDJ: https://djgarybaldy.blogspot.com/2020/08/how-to-install-radiodj-free-radio.html

Into Internet radio for 25 years 1999-2024

RadioDJ 2045 MariaDB 11.2 Windows 11

unpetru

I can talk to the webhost because they are friends of mine. I just need to be able to configure the script. :)
Lounge Avenue (Chillout Radio)
http://lounge-avenue.com

stevewa

in file config.php

$dataport = "3306";  // database port number (You change ports at your own risk)

DJ Garybaldy

#73
Someone else is going to have to come to your rescue here my knowledge on SQL and Changing ports isn't great I'm afraid i know the basics... and sticking to the default port,


I'd be looking into ways of making your SQL server as secure as it can be if you're getting attacked on port 3306.
Worlds Biggest Fan of RadioDJ

Install MariaDB https://djgarybaldy.blogspot.com/2020/08/installing-maria-db.html

Install RadioDJ: https://djgarybaldy.blogspot.com/2020/08/how-to-install-radiodj-free-radio.html

Into Internet radio for 25 years 1999-2024

RadioDJ 2045 MariaDB 11.2 Windows 11

unpetru

Quote from: stevewa on August 09, 2018, 05:08:16 PM
in file config.php

$dataport = "3306";  // database port number (You change ports at your own risk)

This might be it... I will test it and come back :)
Lounge Avenue (Chillout Radio)
http://lounge-avenue.com