Commit 27efc7cd authored by camilo higuita's avatar camilo higuita

now ready for first stable release

parent 3f1537d0
...@@ -1010,26 +1010,26 @@ Maui.ApplicationWindow ...@@ -1010,26 +1010,26 @@ Maui.ApplicationWindow
onRefreshAlbums: H.refreshAlbums() onRefreshAlbums: H.refreshAlbums()
onRefreshArtists: H.refreshArtists() onRefreshArtists: H.refreshArtists()
onCoverReady: // onCoverReady:
{ // {
root.currentArtwork = path // root.currentArtwork = path
currentTrack.artwork = currentArtwork // currentTrack.artwork = currentArtwork
mainPlaylist.list.update(currentTrack, currentTrackIndex); // mainPlaylist.list.update(currentTrack, currentTrackIndex);
} // }
onTrackLyricsReady: // onTrackLyricsReady:
{ // {
console.log(lyrics) // console.log(lyrics)
if (url === currentTrack.url) // if (url === currentTrack.url)
Player.setLyrics(lyrics) // Player.setLyrics(lyrics)
} // }
onSkipTrack: Player.nextTrack() // onSkipTrack: Player.nextTrack()
onBabeIt: if (!mainlistEmpty) // onBabeIt: if (!mainlistEmpty)
{ // {
mainPlaylist.list.fav(currentTrackIndex, !(mainPlaylist.list.get(currentTrackIndex).fav == "1")) // mainPlaylist.list.fav(currentTrackIndex, !(mainPlaylist.list.get(currentTrackIndex).fav == "1"))
currentBabe = mainPlaylist.list.get(currentTrackIndex).fav == "1" // currentBabe = mainPlaylist.list.get(currentTrackIndex).fav == "1"
} // }
onOpenFiles: onOpenFiles:
{ {
......
...@@ -192,20 +192,18 @@ void AlbumsModel::fetchInformation() ...@@ -192,20 +192,18 @@ void AlbumsModel::fetchInformation()
QEventLoop loop; QEventLoop loop;
QObject::connect(&pulpo, &Pulpo::finished, &loop, &QEventLoop::quit); QObject::connect(&pulpo, &Pulpo::finished, &loop, &QEventLoop::quit);
bool stop = false; bool stop = false;
// QObject::connect(qApp, &QCoreApplication::aboutToQuit, [&]()
// {
// stop = true;
// loop.quit();
// });
QObject::connect(this, &AlbumsModel::destroyed, [&]() QObject::connect(this, &AlbumsModel::destroyed, [&]()
{ {
qDebug()<< stop << &stop;
stop = true; stop = true;
qDebug()<< stop << &stop;
}); });
for(auto i = 0; i < requests.size(); i++) for(const auto &req : requests)
{ {
pulpo.request(requests.at(i)); pulpo.request(req);
loop.exec(); loop.exec();
if(stop) if(stop)
{ {
...@@ -232,14 +230,7 @@ QVariantMap AlbumsModel::get(const int &index) const ...@@ -232,14 +230,7 @@ QVariantMap AlbumsModel::get(const int &index) const
{ {
if(index >= this->list.size() || index < 0) if(index >= this->list.size() || index < 0)
return QVariantMap(); return QVariantMap();
return FM::toMap(this->list.at(index));
QVariantMap res;
const auto item = this->list.at(index);
for(auto key : item.keys())
res.insert(FMH::MODEL_NAME[key], item[key]);
return res;
} }
void AlbumsModel::append(const QVariantMap &item) void AlbumsModel::append(const QVariantMap &item)
...@@ -283,5 +274,3 @@ void AlbumsModel::refresh() ...@@ -283,5 +274,3 @@ void AlbumsModel::refresh()
{ {
this->setList(); this->setList();
} }
...@@ -157,14 +157,7 @@ QVariantMap PlaylistsModel::get(const int &index) const ...@@ -157,14 +157,7 @@ QVariantMap PlaylistsModel::get(const int &index) const
{ {
if(index >= this->list.size() || index < 0) if(index >= this->list.size() || index < 0)
return QVariantMap(); return QVariantMap();
return FM::toMap(this->list.at(index));
QVariantMap res;
const auto item = this->list.at(index);
for(auto key : item.keys())
res.insert(FMH::MODEL_NAME[key], item[key]);
return res;
} }
void PlaylistsModel::append(const QVariantMap &item) void PlaylistsModel::append(const QVariantMap &item)
......
...@@ -127,14 +127,7 @@ QVariantMap TracksModel::get(const int &index) const ...@@ -127,14 +127,7 @@ QVariantMap TracksModel::get(const int &index) const
{ {
if(index >= this->list.size() || index < 0) if(index >= this->list.size() || index < 0)
return QVariantMap(); return QVariantMap();
return FM::toMap(this->list.at(index));
QVariantMap res;
const auto item = this->list.at(index);
for(auto key : item.keys())
res.insert(FMH::MODEL_NAME[key], item[key]);
return res;
} }
QVariantList TracksModel::getAll() QVariantList TracksModel::getAll()
......
...@@ -321,7 +321,7 @@ BabeList ...@@ -321,7 +321,7 @@ BabeList
number : trackNumberVisible ? true : false number : trackNumberVisible ? true : false
quickPlay: quickPlayVisible quickPlay: quickPlayVisible
coverArt : coverArtVisible coverArt : coverArtVisible ? (babeTableRoot.width > 300) : coverArtVisible
trackDurationVisible : trackDuration trackDurationVisible : trackDuration
trackRatingVisible : trackRating trackRatingVisible : trackRating
menuItem: menuItemVisible menuItem: menuItemVisible
......
...@@ -31,7 +31,6 @@ vvave::vvave(QObject *parent) : QObject(parent) ...@@ -31,7 +31,6 @@ vvave::vvave(QObject *parent) : QObject(parent)
for(const auto &path : {BAE::CachePath, BAE::YoutubeCachePath}) for(const auto &path : {BAE::CachePath, BAE::YoutubeCachePath})
{ {
QDir dirPath(path); QDir dirPath(path);
if (!dirPath.exists()) if (!dirPath.exists())
dirPath.mkpath("."); dirPath.mkpath(".");
} }
...@@ -81,7 +80,6 @@ void vvave::checkCollection(const QStringList &paths, std::function<void(uint)> ...@@ -81,7 +80,6 @@ void vvave::checkCollection(const QStringList &paths, std::function<void(uint)>
watcher->setFuture(t1); watcher->setFuture(t1);
} }
//// PUBLIC SLOTS //// PUBLIC SLOTS
QVariantList vvave::sourceFolders() QVariantList vvave::sourceFolders()
{ {
......
...@@ -130,6 +130,7 @@ BabeGrid ...@@ -130,6 +130,7 @@ BabeGrid
Layout.fillHeight: true Layout.fillHeight: true
Layout.fillWidth: true Layout.fillWidth: true
trackNumberVisible: true trackNumberVisible: true
trackRating: true
headBar.visible: true headBar.visible: true
headBarExit: false headBarExit: false
coverArtVisible: true coverArtVisible: true
......
...@@ -6,13 +6,14 @@ import "../db/Queries.js" as Q ...@@ -6,13 +6,14 @@ import "../db/Queries.js" as Q
Item Item
{ {
id: control
property alias list : _filterList
property var tracks : []
property string currentFolder : ""
Maui.GridBrowser Maui.GridBrowser
{ {
id: browser id: browser
property alias list : _filterList
property var tracks : []
property string currentFolder : ""
// headBarTitle: qsTr("Source folders") // headBarTitle: qsTr("Source folders")
anchors.margins: space.big anchors.margins: space.big
anchors.fill: parent anchors.fill: parent
...@@ -60,23 +61,23 @@ Item ...@@ -60,23 +61,23 @@ Item
holder.emojiSize: iconSizes.huge holder.emojiSize: iconSizes.huge
} }
} }
}
Component.onCompleted: populate() Component.onCompleted: populate()
function populate() function populate()
{ {
browser.model.clear() browser.model.clear()
var folders = vvave.sourceFolders(); var folders = vvave.sourceFolders();
if(folders.length > 0) if(folders.length > 0)
for(var i in folders) for(var i in folders)
browser.model.append(folders[i]) browser.model.append(folders[i])
} }
function filter() function filter()
{ {
var where = "source = \""+currentFolder+"\"" var where = "source = \""+currentFolder+"\""
_filterList.list.query = (Q.GET.tracksWhere_.arg(where)) _filterList.list.query = (Q.GET.tracksWhere_.arg(where))
}
} }
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment