(2020-03-08, 14:12)black_eagle Wrote: [ -> ]T@enen92 Firstly, thanks for updating this and keeping it current, it's much appreciated.
Now, I see for the sort_methods you have used %X
which is bitrate I believe, but I don't see any rates listed in the GUI. (Only realized this as I've been working on a branch that reads sample rates and bitrates from music files at scan time and stores them in the music db for later use). In fact, I'm not sure the API returns the bitrate of a station anyway, does it ? From the data I see
json:
{'name': 'Vixen 101', 'thumbnail': '', 'rating': 60296, 'genre': 'Oldies', 'mediatype': 'song', 'id': 12219, 'current_track': None, 'stream_url': '', 'description': ''}, {'name': 'News Radio UK', 'thumbnail': 'https://static.radio.net/images/broadcasts/d0/d2/120208/1/c175.png', 'rating': 13110, 'genre': '', 'mediatype': 'song', 'id': 120208, 'current_track': None, 'stream_url': '', 'description': 'News Radio UK brings today’s headlines in 10 minutes, every 10 minutes. Rolling news, sport, weather, travel, business and showbiz 24 hours a day. '}
Also, sort by rating only ever gives me a value of 10.0 for every station. That's clearly wrong but my python isn't up to finding where that is coming from. Obviously, it isn't that big a deal I just wasn't sure if you would be aware of it or not.
They provide the sample rate but you have to query each station by id, so it is not feasible to do it when showing the plugin listings.
json:
{'continent': 'Europe', 'country': 'Portugal', 'logo300x300': 'https://static.radio.net/images/broadcasts/c8/83/13386/2/c300.png', 'city': 'Braga', 'stationType'│
: 'radio_station', 'description': '', 'language': ['Portuguese'], 'logo100x100': 'https://static.radio.net/images/broadcasts/c8/83/13386/2/c100.png', 'streamUrls': [{'streamUrl': 'http://centova.radios.p│
t:9464/stream/1/', 'loadbalanced': False, 'metaDataAvailable': False, 'playingMode': 'STEREO', 'type': 'STREAM', 'sampleRate': 44100, 'streamContentFormat': 'MP3', 'bitRate': 128, 'idBroadcast': 13386, '│
sortOrder': 1, 'streamFormat': 'UNKNOWN', 'id': 112988, 'streamStatus': 'VALID', 'contentType': 'audio/mpeg'}], 'playable': 'PLAYABLE', 'genres': ['Top 40 & Charts'], 'logo175x175': 'https://static.radio│
.net/images/broadcasts/c8/83/13386/2/c175.png', 'adParams': {'st_city': ['Braga'], 'languages': ['Portuguese'], 'genres': ['Top 40 & Charts'], 'topics': [], 'st_cont': ['Europe'], 'station': ['antenaminh│
o'], 'advertising': ['true'], 'family': [], 'st_region': ['Braga'], 'type': ['radio_station'], 'st_country': ['Portugal']}, 'alias': '', 'rank': 11263, 'id': 13386, 'types': ['FM Radio'], 'website': 'htt│
p://www.antena-minho.pt/', 'topics': [], 'shortDescription': '', 'logo44x44': 'https://static.radio.net/images/broadcasts/c8/83/13386/2/c44.png', 'numberEpisodes': 0, 'podcastUrls': [], 'hideReferer': Fa│
lse, 'name': 'Antena Minho', 'subdomain': 'antenaminho', 'lastModified': '2020-04-12T02:38:18.000Z', 'family': [], 'region': 'Braga', 'frequencies': []}
Regarding ratings, it's not easy too. Kodi provides ratings in 10.0 - 0.0. Radio.de lists radios by raking:
radio with ranking 1 -> 10.0 in kodi
radio with ranking ~ 30.000 (they say they have 30.000 radio stations) -> 0.0 in kodi
In the next version I'm doing a simple linear interpolation to calculate the value but kodi is not sensitive enough for this