Cleainging up, bug hunting and optimizing

This commit is contained in:
Niels
2025-06-07 17:19:19 +02:00
parent c96a4c3387
commit 54b997ad61
16 changed files with 329 additions and 440 deletions
+1 -6
View File
@@ -6,10 +6,6 @@ XmlListModel {
property bool clear: false
property ListModel stationsModel: ListModel {id: stationsModel}
// onFinishedChanged: console.log("*** FINISHED: "+finished+" ***")
//onClearChanged: if (clear) {stationsModel.clear()}
query: "/result/station"
XmlRole { name: "stationuuid"; query: "@stationuuid/string()" }
XmlRole { name: "name"; query: "@name/string()" }
@@ -52,10 +48,9 @@ XmlListModel {
"clicktrend" : get(i).clicktrend,
"clickcount" : get(i).clickcount,
"lastcheckok" : get(i).lastcheckok
})
});
}
finished = true
// console.log(" ***** APPENDED ******")
}
}
+1 -8
View File
@@ -13,14 +13,10 @@ Item {
var filt
for(var i = 0; i < xmlModel.count; i++) {
cname = getCountryName(xmlModel.get(i).name)
//if (cname) filt = cname.toLowerCase()
if (cname) {filt = cname.toLowerCase(); if (filt.indexOf(filter) !== -1) countryModel.append({"name" : cname, "alpha_2" : xmlModel.get(i).name,"stationcount" : xmlModel.get(i).stationcount})}
//console.log(cname)
}
countryModel.listModelSort(countryModel, compareElements)
//numberOfCountries = i
countryCount = countryModel.count
// console.log("COUNTRIESMODEL DONE: "+countryModel.count)
radioBrowser.countryCount = countryModel.count
running = false
}
@@ -49,18 +45,15 @@ Item {
XmlListModel {
id: xmlModel
query: "/result/countrycode"
//source: radioServers.serverUrl + type + "/countrycodes?hidebroken=true"
XmlRole { name: "name"; query: "@name/string()" }
XmlRole { name: "stationcount"; query: "@stationcount/string()" }
onStatusChanged: {
//if (status === XmlListModel.Loading) loadingInfo = "Preloading countries"
if (status === XmlListModel.Ready) {
addtomodel()
running = false
}
//if (status === XmlListModel.Loading) running = true;
}
}
+1 -2
View File
@@ -510,8 +510,7 @@ ListModel {
qsTr("Kosovo"),
qsTr("No country")
]
}
}
return countryname.text[index]
}
}
+2 -11
View File
@@ -2,22 +2,14 @@ import QtQuick 2.0
import QtQuick.XmlListModel 2.0
Item {
// radio-browser advanced:
////property int bitrateMin: 0
////property int bitrateMax: 1000000
////property string state: ""
////property bool stateExact: false
////property string language: ""
////property bool languageExact: false
////property string tagList: "" // commaseparated string
property string name: ""
property bool nameExact: false
property string countrycode: ""
property string tag: ""
property bool tagExcact: false
property string codec: ""
property string order: "" // name, url, homepage, favicon, tags, country, state, language, votes, codec, bitrate, lastcheckok, lastchecktime, clicktimestamp, clickcount, clicktrend, random
property bool reverse: false//order === name ? false : true // true if name
property string order: ""
property bool reverse: false
property int offset: 0
property int limit: 150
property string source: ""
@@ -43,7 +35,6 @@ Item {
if (order !== "") filterString = filterString + "&order="+order
if (order === "name") reverse = false; else reverse = true
filterString = filterString + "&reverse="+reverse + "&offset="+offset+"&limit="+limit
// console.log(radioBrowser.serverUrl + "/xml/stations/search?hidebroken=true"+filterString)
source = radioBrowser.serverUrl + "/xml/stations/search?hidebroken=true"+filterString
}
}