From affe35ef35c18884701169776b4cb417aca5b6b3 Mon Sep 17 00:00:00 2001 From: Niels Date: Sat, 14 Jun 2025 17:29:39 +0200 Subject: [PATCH] Small changes, and fixing for chum repo --- qml/harbour-allradio.qml | 2 +- qml/items/RadioBrowser.qml | 11 ++++++++++- qml/items/RadioMprisPlayer.qml | 2 +- qml/items/RadioPlayer.qml | 1 + qml/pages/AllRadio.qml | 2 +- qml/pages/SettingsPage.qml | 18 +++++++----------- rpm/harbour-allradio.spec | 9 ++++++--- translations/harbour-allradio-da.ts | 4 ++-- translations/harbour-allradio-de.ts | 4 ++-- translations/harbour-allradio-en.ts | 4 ++-- translations/harbour-allradio-es.ts | 4 ++-- translations/harbour-allradio-fi.ts | 4 ++-- translations/harbour-allradio-fr.ts | 4 ++-- translations/harbour-allradio-it.ts | 4 ++-- translations/harbour-allradio-pl.ts | 4 ++-- translations/harbour-allradio-ru.ts | 4 ++-- translations/harbour-allradio-sv.ts | 4 ++-- translations/harbour-allradio-uk.ts | 4 ++-- translations/harbour-allradio.ts | 4 ++-- 19 files changed, 51 insertions(+), 42 deletions(-) diff --git a/qml/harbour-allradio.qml b/qml/harbour-allradio.qml index 98d82e8..b8d8940 100644 --- a/qml/harbour-allradio.qml +++ b/qml/harbour-allradio.qml @@ -9,7 +9,7 @@ import "helpers" ApplicationWindow { id: allRadio - property string _version: "2.0.20" + property string _version: "2.0.21" property string _language: Qt.locale().name.slice(0,2) property string _country: Qt.locale().name.slice(-2) property int sleepTime: 0 diff --git a/qml/items/RadioBrowser.qml b/qml/items/RadioBrowser.qml index fcd2d32..82da483 100644 --- a/qml/items/RadioBrowser.qml +++ b/qml/items/RadioBrowser.qml @@ -21,8 +21,10 @@ Item { property int _tags: 0 property int _countries: 0 property int _c: 0 + // Properties to be used in application ------------------------------------------------- property ListModel serversModel : ListModel { id: serversModel } + property ListModel serverStatsModel : ListModel { id: serverStatsModel } property ListModel votedModel : ListModel {id: votedModel} property CountryListModel countriesModel : CountryListModel {id:countriesModel} //property TagListModel tagsModel : TagListModel {id:tagsModel} @@ -89,13 +91,20 @@ Item { getStats() } */ + function connectServer(index) { + if (serversModel.count > 0) { + + server = serversModel.get(index).server + if (serverUrl.length > 7 && url !== serverUrl) {loading=true;serverIndex = index;sTimer.running=false;getStats();} else {loading=true;serverIndex = index;getRandom();} + } + } // Choose a random server from available servers function getRandom(url) { if (serversModel.count > 0) { var random = Math.floor((Math.random() * serversModel.count) + 1) - 1 serverUrl = serversModel.get(random).serverUrl server = serversModel.get(random).server - if (serverUrl.length > 7 && url !== serverUrl) {sTimer.running=false;getStats();} else getRandom(); + if (serverUrl.length > 7 && url !== serverUrl) {sTimer.running=false;getStats();serverIndex=random} else getRandom(); } } diff --git a/qml/items/RadioMprisPlayer.qml b/qml/items/RadioMprisPlayer.qml index 460b64c..9c31437 100644 --- a/qml/items/RadioMprisPlayer.qml +++ b/qml/items/RadioMprisPlayer.qml @@ -11,7 +11,7 @@ MprisPlayer { identity: "AllRadio2" supportedUriSchemes: ["file"] - supportedMimeTypes: ["audio/x-wav", "audio/x-vorbis+ogg", "audio/mpeg", "audio/mp4a-latm", "audio/x-aiff"] + supportedMimeTypes: ["audio/x-wav", "audio/x-vorbis+ogg", "audio/mpeg", "audio/mp4a-latm", "audio/x-aiff", "audio/flac"] canControl: true canGoNext: radioPlayer.playlistIndex < radioPlayer.playlist.count -1 && radioPlayer._favorite diff --git a/qml/items/RadioPlayer.qml b/qml/items/RadioPlayer.qml index b9d25f3..49fa263 100644 --- a/qml/items/RadioPlayer.qml +++ b/qml/items/RadioPlayer.qml @@ -223,6 +223,7 @@ MediaPlayer { } function playStream() { + //console.log(" ********** URL : "+_url_resolved) source = _url_resolved play() isPlaying = true diff --git a/qml/pages/AllRadio.qml b/qml/pages/AllRadio.qml index aa406a4..f07e7ac 100644 --- a/qml/pages/AllRadio.qml +++ b/qml/pages/AllRadio.qml @@ -15,9 +15,9 @@ Page { anchors.bottomMargin: mediaPlayerPanel.visibleSize property int _appStart: Favorites.getSetting("appStart",0) + property bool _loading: radioBrowser.loading property bool stationOk: radioPlayer.stationOk property bool online: radioBrowser.online - property bool _loading: radioBrowser.loading property GetCountryStations getTrending1: GetCountryStations {id: getTrending1} property GetCountryStations getTrending2: GetCountryStations {id: getTrending2} property GetCountryStations getTrendingWorld: GetCountryStations {id: getTrendingWorld} diff --git a/qml/pages/SettingsPage.qml b/qml/pages/SettingsPage.qml index 6826958..8d5832b 100644 --- a/qml/pages/SettingsPage.qml +++ b/qml/pages/SettingsPage.qml @@ -61,24 +61,20 @@ Dialog { ComboBox { id: serverL width: parent.width - label: qsTr("Server") anchors.margins: Theme.paddingLarge - description: qsTr("Select anohter server") - //currentIndex: Favorites.getSetting("appStart",0) + label: qsTr("Connected to") + description: qsTr("Available servers (just information, won't change server yet!)") + currentIndex: radioBrowser.serverIndex menu : ContextMenu { id: contextMenu - Column { Repeater { - model: radioBrowser.serversModel - delegate: QtObject { - property Item child: MenuItem { - text: modelData - onClicked: console.log("***") - } + delegate: MenuItem { + text: server + onClicked: radioBrowser.connectServer(currentIndex)//{radioBrowser.server = serverUrl;radioBrowser.serverIndex=currentIndex;}//console.log("***"+serverUrl) } } - } + } /* menu: ContextMenu { diff --git a/rpm/harbour-allradio.spec b/rpm/harbour-allradio.spec index 35eaaf5..e13b532 100644 --- a/rpm/harbour-allradio.spec +++ b/rpm/harbour-allradio.spec @@ -1,7 +1,7 @@ Name: harbour-allradio Summary: AllRadio -Version: 2.0.20 +Version: 2.0.21 Release: 1 Group: Qt/Qt License: GPLv2 @@ -33,8 +33,11 @@ PackageName: AllRadio2 Type: desktop-application PackagerName: Niels Simonsen (nesnomis) Categories: - - Multimedia -Icon: https://gitea.nesnomis.nu/nesnomis/harbour-allradio/src/branch/master/icons/128x128/harbour-allradio.png + - Radio + - Audio + - Video + - Media +Icon: https://gitea.nesnomis.nu/nesnomis/harbour-allradio/raw/branch/master/icons/128x128/harbour-allradio.png Screenshots: - https://gitea.nesnomis.nu/nesnomis/harbour-allradio/wiki/raw/Screenshot_20250522_222021_001.png - https://gitea.nesnomis.nu/nesnomis/harbour-allradio/wiki/raw/Screenshot_20250522_222038_001.png diff --git a/translations/harbour-allradio-da.ts b/translations/harbour-allradio-da.ts index 46e8d9a..f61bc09 100644 --- a/translations/harbour-allradio-da.ts +++ b/translations/harbour-allradio-da.ts @@ -1267,11 +1267,11 @@ - Server + Connected to - Select anohter server + Available servers (just information, won't change server yet!) diff --git a/translations/harbour-allradio-de.ts b/translations/harbour-allradio-de.ts index 3685b8d..fcc6bad 100644 --- a/translations/harbour-allradio-de.ts +++ b/translations/harbour-allradio-de.ts @@ -1267,11 +1267,11 @@ - Server + Connected to - Select anohter server + Available servers (just information, won't change server yet!) diff --git a/translations/harbour-allradio-en.ts b/translations/harbour-allradio-en.ts index 73bac6f..ec0e51e 100644 --- a/translations/harbour-allradio-en.ts +++ b/translations/harbour-allradio-en.ts @@ -1267,11 +1267,11 @@ - Server + Connected to - Select anohter server + Available servers (just information, won't change server yet!) diff --git a/translations/harbour-allradio-es.ts b/translations/harbour-allradio-es.ts index 82933f1..b6911f4 100644 --- a/translations/harbour-allradio-es.ts +++ b/translations/harbour-allradio-es.ts @@ -1267,11 +1267,11 @@ - Server + Connected to - Select anohter server + Available servers (just information, won't change server yet!) diff --git a/translations/harbour-allradio-fi.ts b/translations/harbour-allradio-fi.ts index 42ab3c4..9577cde 100644 --- a/translations/harbour-allradio-fi.ts +++ b/translations/harbour-allradio-fi.ts @@ -1267,11 +1267,11 @@ - Server + Connected to - Select anohter server + Available servers (just information, won't change server yet!) diff --git a/translations/harbour-allradio-fr.ts b/translations/harbour-allradio-fr.ts index 69a0862..58292ca 100644 --- a/translations/harbour-allradio-fr.ts +++ b/translations/harbour-allradio-fr.ts @@ -1267,11 +1267,11 @@ - Server + Connected to - Select anohter server + Available servers (just information, won't change server yet!) diff --git a/translations/harbour-allradio-it.ts b/translations/harbour-allradio-it.ts index 7e03e0e..989d588 100644 --- a/translations/harbour-allradio-it.ts +++ b/translations/harbour-allradio-it.ts @@ -1267,11 +1267,11 @@ - Server + Connected to - Select anohter server + Available servers (just information, won't change server yet!) diff --git a/translations/harbour-allradio-pl.ts b/translations/harbour-allradio-pl.ts index 923de9c..22028fa 100644 --- a/translations/harbour-allradio-pl.ts +++ b/translations/harbour-allradio-pl.ts @@ -1267,11 +1267,11 @@ - Server + Connected to - Select anohter server + Available servers (just information, won't change server yet!) diff --git a/translations/harbour-allradio-ru.ts b/translations/harbour-allradio-ru.ts index 82d85ee..8a03be2 100644 --- a/translations/harbour-allradio-ru.ts +++ b/translations/harbour-allradio-ru.ts @@ -1267,11 +1267,11 @@ - Server + Connected to - Select anohter server + Available servers (just information, won't change server yet!) diff --git a/translations/harbour-allradio-sv.ts b/translations/harbour-allradio-sv.ts index 2754d4a..e625112 100644 --- a/translations/harbour-allradio-sv.ts +++ b/translations/harbour-allradio-sv.ts @@ -1267,11 +1267,11 @@ - Server + Connected to - Select anohter server + Available servers (just information, won't change server yet!) diff --git a/translations/harbour-allradio-uk.ts b/translations/harbour-allradio-uk.ts index 638e6af..05795ec 100644 --- a/translations/harbour-allradio-uk.ts +++ b/translations/harbour-allradio-uk.ts @@ -1267,11 +1267,11 @@ - Server + Connected to - Select anohter server + Available servers (just information, won't change server yet!) diff --git a/translations/harbour-allradio.ts b/translations/harbour-allradio.ts index 65019c2..28edda5 100644 --- a/translations/harbour-allradio.ts +++ b/translations/harbour-allradio.ts @@ -1267,11 +1267,11 @@ - Server + Connected to - Select anohter server + Available servers (just information, won't change server yet!)