Commit 69d0616a authored by camilo higuita's avatar camilo higuita

Merge branch 'dev-win32-wip' of https://invent.kde.org/kde/vvave into dev-win32-wip

parents f55f4945 6e71fd5a
This diff is collapsed.
......@@ -4,7 +4,7 @@ artist TEXT ,
artwork TEXT ,
wiki TEXT,
PRIMARY KEY(artist)
) ;
);
CREATE TABLE ALBUMS
(
......@@ -14,7 +14,7 @@ artwork TEXT,
wiki TEXT,
PRIMARY KEY(album, artist),
FOREIGN KEY(artist) REFERENCES artists(artist)
) ;
);
CREATE TABLE TAGS
(
......@@ -22,38 +22,37 @@ tag TEXT NOT NULL,
context TEXT NOT NULL,
PRIMARY KEY(tag, context)
) ;
);
CREATE TABLE MOODS
(
mood TEXT PRIMARY KEY
) ;
);
CREATE TABLE PLAYLISTS
(
playlist TEXT PRIMARY KEY ,
playlist TEXT PRIMARY KEY,
adddate DATE NOT NULL
) ;
);
CREATE TABLE SOURCES_TYPES
(
id INTEGER PRIMARY KEY ,
id INTEGER PRIMARY KEY,
name TEXT NOT NULL
) ;
);
CREATE TABLE FOLDERS
(
url TEXT PRIMARY KEY,
url TEXT PRIMARY KEY,
adddate DATE NOT NULL
) ;
);
CREATE TABLE SOURCES
(
url TEXT PRIMARY KEY ,
sourcetype INTEGER NOT NULL,
FOREIGN KEY(sourcetype) REFERENCES SOURCES_TYPES(id)
) ;
);
CREATE TABLE TRACKS
(
......@@ -77,8 +76,7 @@ wiki TEXT NOT NULL,
PRIMARY KEY (url),
FOREIGN KEY(source) REFERENCES SOURCES(url),
FOREIGN KEY(album, artist) REFERENCES albums(album, artist)
) ;
);
CREATE TABLE TRACKS_MOODS
(
......@@ -86,8 +84,7 @@ mood TEXT NOT NULL ,
url TEXT NOT NULL ,
FOREIGN KEY(mood) REFERENCES MOODS(mood),
FOREIGN KEY(url) REFERENCES TRACKS(url)
) ;
);
CREATE TABLE TRACKS_TAGS
(
......@@ -97,8 +94,7 @@ url TEXT NOT NULL ,
PRIMARY KEY (tag, context, url),
FOREIGN KEY(tag, context) REFERENCES TAGS(tag, context),
FOREIGN KEY(url) REFERENCES TRACKS(url)
) ;
);
CREATE TABLE ARTISTS_TAGS
(
......@@ -108,8 +104,7 @@ artist TEXT NOT NULL ,
PRIMARY KEY (tag, context, artist),
FOREIGN KEY(tag, context) REFERENCES TAGS(tag, context),
FOREIGN KEY(artist) REFERENCES ARTISTS(artist)
) ;
);
CREATE TABLE ALBUMS_TAGS
(
......@@ -120,7 +115,7 @@ artist TEXT NOT NULL,
PRIMARY KEY (tag, context, album, artist),
FOREIGN KEY(tag, context) REFERENCES TAGS(tag, context),
FOREIGN KEY(album, artist) REFERENCES ALBUMS(album, artist)
) ;
);
CREATE TABLE PLAYLISTS_MOODS
(
......@@ -129,8 +124,7 @@ mood TEXT NOT NULL ,
PRIMARY KEY (playlist, mood),
FOREIGN KEY(playlist) REFERENCES PLAYLISTS(playlist),
FOREIGN KEY(mood) REFERENCES MOODS(mood)
) ;
);
CREATE TABLE TRACKS_PLAYLISTS
(
......@@ -140,14 +134,13 @@ adddate DATE NOT NULL,
PRIMARY KEY (playlist, url),
FOREIGN KEY(playlist) REFERENCES PLAYLISTS(playlist),
FOREIGN KEY(url) REFERENCES TRACKS(url)
) ;
);
CREATE TABLE LOG
(
id INTEGER NOT NULL,
adddate DATE NOT NULL,
PRIMARY KEY(id)
);
......
......@@ -54,13 +54,12 @@ Maui.ApplicationWindow
/******************** PLAYBACK ********************/
/*************************************************/
property bool isShuffle: Maui.FM.loadSettings("SHUFFLE","PLAYBACK", false)
readonly property var currentTrack: mainlistEmpty? ({url: "", artwork: "", fav: "0", stars: "0"}) : mainPlaylist.table.listModel.get(currentTrackIndex)
property var currentTrack: mainlistEmpty? ({url: "", artwork: "", fav: "0", stars: "0"}) : mainPlaylist.table.listModel.get(currentTrackIndex)
property int currentTrackIndex: -1
property int prevTrackIndex: 0
readonly property string currentArtwork: currentTrack.artwork
readonly property bool currentBabe: currentTrack.fav == "0" ? false : true
property alias durationTimeLabel: player.duration
property string progressTimeLabel: player.transformTime((player.duration/1000) *(player.pos/ 1000))
......@@ -523,11 +522,10 @@ Maui.ApplicationWindow
id: babeBtnIcon
icon.name: "love"
enabled: currentTrackIndex >= 0
icon.color: currentBabe ? babeColor : Kirigami.Theme.textColor
icon.color: currentTrack.fav == "0" ? babeColor : Kirigami.Theme.textColor
onClicked: if (!mainlistEmpty)
{
mainPlaylist.list.fav(currentTrackIndex, !(mainPlaylist.listModel.get(currentTrackIndex).fav == "1"))
currentBabe = mainPlaylist.listModel.get(currentTrackIndex).fav == "1"
}
},
......
......@@ -38,7 +38,8 @@ Cloud::Cloud(QObject *parent) : MauiList (parent),
void Cloud::componentComplete()
{
this->provider->setCredentials(FMH::toModel(MauiAccounts::instance()->getCurrentAccount()));
this->setList();
}
void Cloud::setSortBy(const Cloud::SORTBY &sort)
......
......@@ -32,7 +32,7 @@ static inline QList<QUrl> getPathContents(QList<QUrl> &urls, const QUrl &url)
// returns the number of new items added to the collection db
static inline uint getTracks(const QList<QUrl>& paths)
{
auto db = CollectionDB::getInstance();
const auto db = CollectionDB::getInstance();
const auto urls = std::accumulate(paths.begin(), paths.end(), QList<QUrl>(), getPathContents);
for(const auto &path : paths)
......@@ -53,6 +53,8 @@ static inline uint getTracks(const QList<QUrl>& paths)
if(info.isNull())
continue;
qDebug()<< url << "HHH";
const auto track = info.getTrack();
const auto genre = info.getGenre();
const auto album = BAE::fixString(info.getAlbum());
......@@ -62,7 +64,6 @@ static inline uint getTracks(const QList<QUrl>& paths)
const auto duration = info.getDuration();
const auto year = info.getYear();
FMH::MODEL trackMap =
{
{FMH::MODEL_KEY::URL, url.toString()},
......
#include "player.h"
#include "../../utils/bae.h"
//#ifdef STATIC_MAUIKIT
//#include "mauiaccounts.h"
//#else
//#include <mauiaccounts.h>
//#endif
#ifdef STATIC_MAUIKIT
#include "mauiaccounts.h"
#else
#include <mauiaccounts.h>
#endif
Player::Player(QObject *parent) : QObject(parent),
player(new QMediaPlayer(this)),
......@@ -27,8 +27,8 @@ inline QNetworkRequest getOcsRequest(const QNetworkRequest& request)
rawHeaders.insert(headerKey, request.rawHeader(headerKey));
}
// const auto account = FMH::toModel(MauiAccounts::instance()->getCurrentAccount());
const auto account = FMH::MODEL();
const auto account = FMH::toModel(MauiAccounts::instance()->getCurrentAccount());
// const auto account = FMH::MODEL();
const QString concatenated = QString("%1:%2").arg(account[FMH::MODEL_KEY::USER], account[FMH::MODEL_KEY::PASSWORD]);
const QByteArray data = concatenated.toLocal8Bit().toBase64();
......
......@@ -27,7 +27,8 @@ TagInfo::TagInfo(const QString &url, QObject *parent) : QObject(parent)
if(_file.isReadable())
{
this->file = new TagLib::FileRef(TagLib::FileName(this->path.toStdWString().c_str()));
qDebug()<< "is readble";
this->file = new TagLib::FileRef(path.toUtf8());
}
else
this->file = new TagLib::FileRef();
......@@ -36,12 +37,12 @@ TagInfo::TagInfo(const QString &url, QObject *parent) : QObject(parent)
TagInfo::~TagInfo()
{
qDebug()<< "DELETING TAGINFO";
// delete this->file;
delete this->file;
}
bool TagInfo::isNull()
{
return this->file->isNull() && this->file->tag() == nullptr ;
return this->file->isNull();
}
QString TagInfo::getAlbum() const
......
......@@ -28,7 +28,7 @@ Maui.Page
anchors.fill: parent
holder.visible: count === 0
topMargin: Maui.Style.space.medium
listView.headerPositioning: ListView.PullBackHeader
listView.headerPositioning: Kirigami.Settings.isMobile ? ListView.PullBackHeader : ListView.OverlayHeader
listView.footerPositioning: ListView.OverlayFooter
Kirigami.Theme.colorSet: Kirigami.Theme.Window
Kirigami.Theme.inherit: false
......
......@@ -11,12 +11,12 @@ import "../../db/Queries.js" as Q
Maui.Dialog
{
title: "Add "+ tracks.length +" tracks to..."
property var tracks : []
maxHeight: 400 * Maui.Style.unit
page.padding: Maui.Style.space.medium
acceptButton.text: qsTr("Save")
rejectButton.text: qsTr("Cancel")
ColumnLayout
{
anchors.fill: parent
......
......@@ -165,6 +165,7 @@ Maui.Page
holder.emoji: "qrc:/assets/dialog-information.svg"
holder.title : qsTr("Opps!")
holder.body: qsTr("You don't have an account set up.\nYou can set up your account now by clicking here or under the Accounts options in the main menu")
listView.spacing: Maui.Style.space.small * (Kirigami.Settings.isMobile ? 1.4 : 1.2)
Connections
{
......@@ -238,6 +239,13 @@ Maui.Page
width: parent.width
number : false
coverArt : false
ToolButton
{
icon.name: "document-download"
Layout.fillHeight: true
}
onClicked:
{
_listView.currentIndex = index
......
......@@ -379,11 +379,10 @@ Maui.Page
icon.height: Maui.Style.iconSizes.big
icon.name: "love"
enabled: currentTrackIndex >= 0
icon.color: currentBabe ? babeColor : Kirigami.Theme.textColor
icon.color: currentTrack.fav == "0" ? babeColor : Kirigami.Theme.textColor
onClicked: if (!mainlistEmpty)
{
mainPlaylist.list.fav(currentTrackIndex, !(mainPlaylist.list.get(currentTrackIndex).fav == "1"))
currentBabe = mainPlaylist.list.get(currentTrackIndex).fav == "1"
}
},
......
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