diff --git a/CHANGELOG.md b/CHANGELOG.md index b79847f..185e3c8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,29 +7,12 @@ - Continious scrolling [#13](https://git.project-insanity.org/onny/nextcloud-app-radio/commit/c8e86558d0a1ceeea21f801f6e2391ab70046a4e) @onny - Loading animation - [#25](https://git.project-insanity.org/onny/nextcloud-app-radio/commit/c8e86558d0a1ceeea21f801f6e2391ab70046a4e) @onny - -### Changed -- Minimum server is Nextcloud 10/ownCloud 9.1 - [#84](https://github.com/nextcloud/mail/pull/84) @ChristophWurst -- Use session storage instead of local storage for client-side cache - [#1612](https://github.com/owncloud/mail/pull/1612) @ChristophWurst -- When deleting the current message, the next one is selected immediatelly - [#1585](https://github.com/owncloud/mail/pull/1585) @ChristophWurst + [#25](https://git.project-insanity.org/onny/nextcloud-app-radio/commit/9624b4dc4c5770df93b548736c1be43b96d6dea5) @onny ### Fixed - Fix missing background color for first td in table row [#32](https://git.project-insanity.org/onny/nextcloud-app-radio/commit/9e5b7961009ca7842f8a025de59cb3acaae2bea1) @onny -### Removed -- Removed old API - -### Deprecated -- Deprecated new API - -### Security -- Fixed XXE in xml upload - ## 0.5.0 – 2017-08-06 ### Added - First release diff --git a/js/main.js b/js/main.js index abe5ebd..bf55be9 100644 --- a/js/main.js +++ b/js/main.js @@ -157,7 +157,7 @@ $(function(){ }); }; - function render_result(data){ + function render_results(data){ var baseUrl = OC.generateUrl('/apps/radio'); $.get(baseUrl + '/stations', function ( fav_stations ) { @@ -165,6 +165,7 @@ $(function(){ $.each(data, function(i, station) { var isstarred = "" + for (var fav_station in fav_stations) { if (fav_stations[fav_station]["stationid"] == station['id']) { isstarred = "starred"; @@ -200,18 +201,22 @@ $(function(){ for (var station in data) { stations.push(data[station]["stationid"]); }; - render_stations(stations); + query_stations(stations); }); }; - function render_stations(station_ids){ + function query_stations(station_ids){ + var station_array = []; for (stationid in station_ids){ $.ajax({ method: "GET", url: "https://www.radio-browser.info/webservice/json/stations/byid/"+station_ids[stationid], dataType: 'json', }).success( function(data){ - render_result(data); + station_array = station_array.concat(data); + if (station_array.length == station_ids.length){ + render_results(station_array); + }; }); }; }; @@ -239,7 +244,7 @@ $(function(){ }, dataType: 'json', }).success( function(data){ - render_result(data); + render_results(data); }); }; diff --git a/templates/main.php b/templates/main.php index 1a79b15..b5a2a41 100755 --- a/templates/main.php +++ b/templates/main.php @@ -32,6 +32,7 @@