Your browser was unable to load all of the resources. They may have been blocked by your firewall, proxy or browser configuration.
Press Ctrl+F5 or Ctrl+Shift+R to have your browser try again.

Updated to version 1.52 Personalised Radio Does Not find any tracks #52

#1

Mark,

I have just updated from version 1.48 to version 1.52

installed php-intl extension

I backed up my rompr folder, deleted everything in it, then restored my albumart and prefs folders

then unzipped version 1.52 into it

then restarted my server

everything seems to start up ok and albums appear to play correctly

but none of my personalised radio stations appear to work they all return "Didnt find any tracks"

I have tried deleting and recreating a station but it does not make any difference

as an example one the stations contains the following rules

Genre does not contain xmas
year is less than 1970
year is greater than 1959

not surprisingly the station is named 1960s

let me know if you need any more info

Tim

  • replies 11
  • views 2.5K
  • likes 2
tkgafs · Author
#2

I found this in the nginx error log

[root@Rompr nginx]# cat error.log
2021/02/17 10:10:01 [error] 870#870: *7 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught TypeError: PDOStatement::fetchAll(): Argument #2 must be of type int, string given in /www/nginx/rompr/backends/sql/data_base.class.php:148
Stack trace:
#0 /www/nginx/rompr/backends/sql/data_base.class.php(148): PDOStatement->fetchAll()
#1 /www/nginx/rompr/radios/backend/collection_radio.class.php(266): data_base->sql_prepare_query()
#2 /www/nginx/rompr/radios/backend/collection_radio.class.php(84): collection_radio->get_tracks()
#3 /www/nginx/rompr/radios/api/starRadios.php(13): collection_radio->doPlaylist()
#4 {main}
thrown in /www/nginx/rompr/backends/sql/data_base.class.php on line 148" while reading response header from upstream, client: 192.168.xx.yy, server: rompr.localdomain, request: "POST /radios/api/starRadios.php HTTP/1.1", upstream: "fastcgi://unix:/run/php-fpm/php-fpm.sock:", host: "rompr.localdomain", referrer: "http://rompr.localdomain/"
[root@Rompr nginx]#

#3

well that's disturbing.

What version of PHP are you running? A more detailed debug log would also help.

The error message implies that the behaviour of fetchAll() is not consistent between different installtions of PHP, because I'm not passing it an integer, and I have never passed it an integer....

#4

Another thing you could look at, if you go to the Personalised Radio panel and click on the drop down menu for Genre or Tracks By Artist, do you get a drop down menu or do you get nothing?

tkgafs · Author
#5

I'm running on Archlinux

php -v reports the folowing

PHP 8.0.2 (cli) (built: Feb 2 2021 18:26:02) ( NTS )

If I click drop downs for Genere or Tracks by artist I get nothing

I'll get a debug log later on today (busy busy ... !!)

#6

Thanks that's probably enough info. I'm still on php 7.

Seems like PHP 8 has changed something fundamental internally but never thought to warn anybody. I've checked the docs and it's a simple fix, but not sure when I'll get around to it. Look out for version 1.53

tkgafs · Author
#7

Debug option set to level 7

[root@Rompr rompr]# cat debug.log
12:43:01 [310] LOG : CUSTOMRADIO : Saving Station 1960s
12:43:01 [264] LOG : SAVEPREFS : Saving prefs
12:43:01 [264] LOG : SAVEPREFS : radiomode = starRadios
12:43:01 [264] LOG : SAVEPREFS : radioparam = custom+1960s
12:43:01 [265] LOG : SAVEPREFS : Saving prefs
12:43:01 [265] LOG : SAVEPREFS : radioconsume = [["consume","1"],["repeat","0"],["random","0"]]
12:43:01 [265] LOG : SAVEPREFS : radiomaster = 1594119747070
12:43:01 [310] DEBUG : POSTCOMMAND : RAW command : 0=repeat 1=0
12:43:01 [310] DEBUG : POSTCOMMAND : RAW command : 0=random 1=0
12:43:01 [310] DEBUG : POSTCOMMAND : RAW command : 0=consume 1=1
12:43:01 [310] TRACE : MPD (do_command_list) : Command List: repeat "0"
12:43:01 [310] TRACE : MPD (do_command_list) : Command List: random "0"
12:43:01 [310] TRACE : MPD (do_command_list) : Command List: consume "1"
12:43:01 [310] TRACE : MPD (do_mpd_command) : MPD Command command_list_end
12:43:01 [264] DEBUG : POSTCOMMAND : RAW command : 0=stop
12:43:01 [264] DEBUG : POSTCOMMAND : RAW command : 0=clear
12:43:01 [264] TRACE : MPD (do_command_list) : Command List: stop
12:43:01 [264] TRACE : MPD (do_command_list) : Command List: clear
12:43:01 [264] TRACE : MPD (do_mpd_command) : MPD Command command_list_end
12:43:01 [265] LOG : MPD (parse_list_output) : MPD Parse playlistinfo
12:43:02 [310] MARK : SMARTRADIO : Loading Playlist custom+1960s limit 5
12:43:02 [310] LOG : CUSTOMRADIO (smart_radio_custom) : Genre Xmas
12:43:02 [310] LOG : CUSTOMRADIO (smart_radio_custom) : TYear 1970
12:43:02 [310] LOG : CUSTOMRADIO (smart_radio_custom) : TYear 1959
12:43:02 [310] LOG : GET TRACKS (get_tracks) : SELECT DISTINCT Uri FROM
Tracktable
JOIN Artisttable AS ta USING (Artistindex)
JOIN Albumtable USING (Albumindex)
JOIN Artisttable AS aa ON (Albumtable.AlbumArtistindex = aa.Artistindex)
LEFT JOIN Genretable USING (Genreindex)
LEFT JOIN Ratingtable USING (TTindex)
LEFT JOIN Playcounttable USING (TTindex)
LEFT JOIN TagListtable USING (TTindex)
LEFT JOIN Tagtable USING (Tagindex)
WHERE ((LOWER(Genre) NOT LIKE ?) AND (TYear < ?) AND (TYear > ?)) AND (LinkChecked = 0 OR LinkChecked = 2) AND isAudiobook = 0 AND usedInPlaylist = 0 AND isSearchResult < 2 AND Hidden = 0 AND Uri IS NOT NULL ORDER BY RANDOM() LIMIT 5
12:43:02 [310] LOG : GETALLURILS (get_tracks) : Param : %xmas%
12:43:02 [310] LOG : GETALLURILS (get_tracks) : Param : 1970
12:43:02 [310] LOG : GETALLURILS (get_tracks) : Param : 1959
12:43:02 [264] LOG : SAVEPREFS : Saving prefs
12:43:02 [264] LOG : SAVEPREFS : radiomode =
12:43:02 [264] LOG : SAVEPREFS : radioparam =
12:43:02 [265] DEBUG : POSTCOMMAND : RAW command : 0=consume 1=1
12:43:02 [265] DEBUG : POSTCOMMAND : RAW command : 0=repeat 1=0
12:43:02 [265] DEBUG : POSTCOMMAND : RAW command : 0=random 1=0
12:43:02 [265] TRACE : MPD (do_command_list) : Command List: consume "1"
12:43:02 [265] TRACE : MPD (do_command_list) : Command List: repeat "0"
12:43:02 [265] TRACE : MPD (do_command_list) : Command List: random "0"
12:43:02 [265] TRACE : MPD (do_mpd_command) : MPD Command command_list_end
[root@Rompr rompr]#

tkgafs · Author
#8

At https://www.php.net/manual/en/pdostatement.fetchall.php

i found the following comment although I dont understand it !!!

There is a breaking change upgrading from PHP<7.4 to PHP 8.0. If your class extend PDOStatement, the PHP 8.0 typed prototype is incompatible :

  • PHP 7.4 = public PDOStatement::fetchAll ([ int $fetch_style [, mixed $fetch_argument [, array $ctor_args = array() ]]] ) : array
  • PHP 8.0 = public PDOStatement::fetchAll ([ int $mode = PDO::FETCH_BOTH[, mixed ...$args] ]) : array

While they are compatible for a human being, PHP is not enjoying it :

  • PHP 7.4 = PHP Warning: Declaration of (your class prototype) should be compatible with (PDOStatement's prototype)
  • PHP 8.0 = [PhpCompileError] Declaration of (your class prototype) must be comptable with (PDOStatement's prototype)

Because the first one is a warning, it is not fatal, and you might be happy using PHP 8.0's prototype. My personal solution was to stop extending PDOStatement and thus rewrite associated typing declarations and conditions.

tkgafs · Author
#9

Sorry came back in and hadnt noticed your comment that you already had enough info

#10

No problem. Try 1.53, just uploaded.

tkgafs · Author
#11

Thanks for your quick response

everything seems to be working correctly :)

will this version work on both php 7 and php 8 ?

#12

will this version work on both php 7 and php 8.

I hope so :D