diff --git a/qml/FakeMainPage.qml b/qml/FakeMainPage.qml index 74d705d..b27b4df 100644 --- a/qml/FakeMainPage.qml +++ b/qml/FakeMainPage.qml @@ -50,19 +50,19 @@ Item { id: fakeModel ListElement { - name: "Arrullo De Estrellas"; group: "Zoé" + name: "Arrullo De Estrellas"; artist: "Zoé" length: "4:14"; comment: "Bonita canción que me hace pensar en ti.." code: ""; url: "xxx" } ListElement { - name: "Goodbye Lovers and Friends"; group: "Franz Ferdinand" + name: "Goodbye Lovers and Friends"; artist: "Franz Ferdinand" length: "4:34"; comment: "I love this song!" code: ""; url: "xxx" } ListElement { - name: "Addicted to you"; group: "Avicii" + name: "Addicted to you"; artist: "Avicii" length: "3:24"; comment: "I am addicted to you" code: ""; url: "xxx" } diff --git a/qml/MainPage.qml b/qml/MainPage.qml index 9950c16..8df1ccc 100644 --- a/qml/MainPage.qml +++ b/qml/MainPage.qml @@ -77,7 +77,7 @@ Page { onRequestedPlay: { if (playlist.count >= index) { - playbackControls.song = playlist.get(index).name + " - " + playlist.get(index).group + "" + playbackControls.song = playlist.get(index).name + " - " + playlist.get(index).artist + "" audioElement.source = model.url audioElement.index = index audioElement.play() @@ -92,12 +92,12 @@ Page { if (index < playlist.count - 1) { /// Will copy next item data, no need to change index - playbackControls.song = playlist.get(index + 1).name + " - " + playlist.get(index + 1).group + "" + playbackControls.song = playlist.get(index + 1).name + " - " + playlist.get(index + 1).artist + "" audioElement.source = playlist.get(index + 1).url audioElement.play() } else if (index - 1 >= 0) { /// Will copy previous item data, update index to -1 - playbackControls.song = playlist.get(index - 1).name + " - " + playlist.get(index - 1).group + "" + playbackControls.song = playlist.get(index - 1).name + " - " + playlist.get(index - 1).artist + "" audioElement.source = playlist.get(index - 1).url audioElement.index = audioElement.index - 1 audioElement.play() @@ -117,6 +117,6 @@ Page { } //Component.onCompleted: playlist.append({"name" : "First Song", - //"group" : "First Group", "length" : "3:31", "comment" : "this is a test", + //"artist" : "First Group", "length" : "3:31", "comment" : "this is a test", //"code" : "XASDDASD", "url": "invalid", "picture": "crazytest"}) } diff --git a/qml/SearchPage.qml b/qml/SearchPage.qml index 824567a..59076cd 100644 --- a/qml/SearchPage.qml +++ b/qml/SearchPage.qml @@ -198,7 +198,7 @@ Page { } playlist.append({ "name" : model.name, - "group" : model.group, + "artist" : model.artist, "length" : model.length, "comment" : model.comment, "code" : model.code, diff --git a/qml/SongDelegate.qml b/qml/SongDelegate.qml index 915ee2d..d00fa87 100644 --- a/qml/SongDelegate.qml +++ b/qml/SongDelegate.qml @@ -71,7 +71,7 @@ Item { Layout.fillWidth: true color: Style.TEXT_COLOR_DARK elide: Text.ElideRight - text: model.name + " - " + model.group + "" + text: model.name + " - " + model.artist + "" renderType: Text.NativeRendering maximumLineCount: 1 } diff --git a/qml/main.qml b/qml/main.qml index 55a77b8..dc70009 100644 --- a/qml/main.qml +++ b/qml/main.qml @@ -29,7 +29,7 @@ ApplicationWindow { else audio.index = 0 - playbackControls.song = playlist.get(audio.index).name + " - " + playlist.get(audio.index).group + "" + playbackControls.song = playlist.get(audio.index).name + " - " + playlist.get(audio.index).artist + "" audio.source = playlist.get(audio.index).url audio.play() } @@ -40,7 +40,7 @@ ApplicationWindow { else audio.index = playlist.count - 1 - playbackControls.song = playlist.get(audio.index).name + " - " + playlist.get(audio.index).group + "" + playbackControls.song = playlist.get(audio.index).name + " - " + playlist.get(audio.index).artist + "" audio.source = playlist.get(audio.index).url audio.play() } @@ -107,7 +107,7 @@ ApplicationWindow { onRowsInserted: { // If new item is first on list, play it if (count === 1) { - playbackControls.song = playlist.get(audio.index).name + " - " + playlist.get(audio.index).group + "" + playbackControls.song = playlist.get(audio.index).name + " - " + playlist.get(audio.index).artist + "" audio.source = playlist.get(audio.index).url audio.play() } else if (audio.status == Audio.EndOfMedia) { diff --git a/qml/testModels/TestSearchModel.qml b/qml/testModels/TestSearchModel.qml index 257a23f..ea97e0d 100644 --- a/qml/testModels/TestSearchModel.qml +++ b/qml/testModels/TestSearchModel.qml @@ -4,7 +4,7 @@ ListModel { id: testModel ListElement { name: "Labios Rotos" - group: "Zoe" + artist: "Zoe" picture: "zoe" length: "3:40" comment: "Bonita canción" @@ -13,7 +13,7 @@ ListModel { } ListElement { name: "Yesterday" - group: "The Beatles" + artist: "The Beatles" picture: "beatles" length: "2:58" comment: "The yellow submarine!" @@ -22,7 +22,7 @@ ListModel { } ListElement { name: "Another one bites the dust" - group: "Queen" + artist: "Queen" picture: "queen" length: "3:14" comment: "We are the champions my friend!" @@ -31,7 +31,7 @@ ListModel { } ListElement { name: "hips don't lie" - group: "Shakira" + artist: "Shakira" picture: "shakira" length: "3:22" comment: "Waka waka!" @@ -40,7 +40,7 @@ ListModel { } ListElement { name: "Hotel Room Service" - group: "Pitbull" + artist: "Pitbull" picture: "pitbull" length: "4:15" comment: "Ya tu sabe!" @@ -49,7 +49,7 @@ ListModel { } ListElement { name: "Song Name" - group: "Fake" + artist: "Fake" picture: "crazystuff" length: "3:10" comment: "This a long useful comment" diff --git a/src/downloader.cpp b/src/downloader.cpp index 38184da..c2198f8 100644 --- a/src/downloader.cpp +++ b/src/downloader.cpp @@ -198,11 +198,11 @@ void Downloader::downloadFinished(QNetworkReply *reply) termEnds = songs.indexOf(closingTerm, termBegins); QString tmp = songs.mid(termBegins, termEnds - termBegins); - QString group = tmp.mid(0, tmp.indexOf(" -")); - QString title = tmp.mid(tmp.indexOf("- ") + 2); + QString artist = tmp.mid(0, tmp.indexOf(" -")); + QString title = tmp.mid(tmp.indexOf("- ") + 1); - if (group == "") - group = tmp; + if (artist == "") + artist = tmp; if (title == "") title = tmp; @@ -256,13 +256,13 @@ void Downloader::downloadFinished(QNetworkReply *reply) comment = comment.mid(termBegins, termEnds - termBegins); // qDebug() << "ADDDING SONG:"; - // qDebug() << "TITLE:" << title << "GROUP:" << group << "LENGTH:" << length + // qDebug() << "TITLE:" << title << "ARTIST:" << artist << "LENGTH:" << length // << "COMMENT:" << comment << "KBPS:" << kbps << "CODE:" << code // << "PICTURE:" << picture; songs = songs.mid(songs.indexOf("