Skip to content

Commit

Permalink
service: handle custom search
Browse files Browse the repository at this point in the history
  • Loading branch information
janbar committed Nov 24, 2023
1 parent ca57cb1 commit 4e1ea43
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 37 deletions.
39 changes: 21 additions & 18 deletions gui/controls2_509/components/Dialog/DialogSearchMusic.qml
Original file line number Diff line number Diff line change
Expand Up @@ -64,25 +64,28 @@ DialogBase {
if (list.length) {
for (var i = 0; i < list.length; ++i) {
var id = list[i];
var tr;
if (id === "artists")
tr = qsTr("Artists");
else if (id === "albums")
tr = qsTr("Albums");
else if (id === "tracks")
tr = qsTr("Tracks");
else if (id === "playlists")
tr = qsTr("Playlists");
else if (id === "stations")
tr = qsTr("Radios");
else if (id === "podcasts")
tr = qsTr("Podcasts");
else if (id === "genres")
tr = qsTr("Genres");
else if (id === "composers")
tr = qsTr("Composers")
var tt = id.split("::", 2);
var tr = "";
if (tt.length > 1)
tr = tt[1] + " / ";
if (tt[0] === "artists")
tr += qsTr("Artists");
else if (tt[0] === "albums")
tr += qsTr("Albums");
else if (tt[0] === "tracks")
tr += qsTr("Tracks");
else if (tt[0] === "playlists")
tr += qsTr("Playlists");
else if (tt[0] === "stations")
tr += qsTr("Radios");
else if (tt[0] === "podcasts")
tr += qsTr("Podcasts");
else if (tt[0] === "genres")
tr += qsTr("Genres");
else if (tt[0] === "composers")
tr += qsTr("Composers")
else
tr = id;
tr += tt[0];
selectorModel.insert(i, {'id': id, 'text': tr});
if (searchType && id === searchType)
selector.currentIndex = i;
Expand Down
39 changes: 21 additions & 18 deletions gui/controls2_515/components/Dialog/DialogSearchMusic.qml
Original file line number Diff line number Diff line change
Expand Up @@ -64,25 +64,28 @@ DialogBase {
if (list.length) {
for (var i = 0; i < list.length; ++i) {
var id = list[i];
var tr;
if (id === "artists")
tr = qsTr("Artists");
else if (id === "albums")
tr = qsTr("Albums");
else if (id === "tracks")
tr = qsTr("Tracks");
else if (id === "playlists")
tr = qsTr("Playlists");
else if (id === "stations")
tr = qsTr("Radios");
else if (id === "podcasts")
tr = qsTr("Podcasts");
else if (id === "genres")
tr = qsTr("Genres");
else if (id === "composers")
tr = qsTr("Composers")
var tt = id.split("::", 2);
var tr = "";
if (tt.length > 1)
tr = tt[1] + " / ";
if (tt[0] === "artists")
tr += qsTr("Artists");
else if (tt[0] === "albums")
tr += qsTr("Albums");
else if (tt[0] === "tracks")
tr += qsTr("Tracks");
else if (tt[0] === "playlists")
tr += qsTr("Playlists");
else if (tt[0] === "stations")
tr += qsTr("Radios");
else if (tt[0] === "podcasts")
tr += qsTr("Podcasts");
else if (tt[0] === "genres")
tr += qsTr("Genres");
else if (tt[0] === "composers")
tr += qsTr("Composers")
else
tr = id;
tr += tt[0];
selectorModel.insert(i, {'id': id, 'text': tr});
if (searchType && id === searchType)
selector.currentIndex = i;
Expand Down

0 comments on commit 4e1ea43

Please sign in to comment.