Skip to content

Commit

Permalink
Merge branch 'devel' into enable-sandboxing
Browse files Browse the repository at this point in the history
  • Loading branch information
Olf0 authored Apr 11, 2024
2 parents 3233241 + dee0d51 commit cc334f1
Show file tree
Hide file tree
Showing 25 changed files with 1,936 additions and 370 deletions.
1 change: 1 addition & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,7 @@ Accurate notices of copyright ownership:
- (C) 2024 Tomasz Sterna (smokku) <[email protected]>
- (C) 2024 David Llewellyn-Jones (llewelld / flypig) <[email protected]>
- (C) 2024 Ruben de Smet (rubdos) <[email protected]>
- (C) 2024 Mark Washeim (poetaster) <[email protected]>

Exhibit B - "Incompatible With Secondary Licenses" Notice
---------------------------------------------------------
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
<br />

#### Features:
- *A pull request for [the README.md](https://github.com/sailfishos-applications/flowplayer/blob/devel/README.md) which provides a list of features will be much appreciated.*
- Gap-less playback, optionally
- *A pull request for [the README.md](https://github.com/sailfishos-applications/flowplayer/blob/devel/README.md) which provides a full list of features will be much appreciated.*

<sup>Note that the functionality and / or ability to … may be broken (this is [known for internet radio](https://github.com/sailfishos-applications/flowplayer/issues/62)) due to API changes in recent SailfishOS releases.</sup><br />
Pull requests with fixes, improvements and enhancements are welcome!
Expand Down Expand Up @@ -36,7 +37,7 @@ If you want to translate FlowPlayer to a language it does not support yet or imp

The original [FlowPlayer for SailfishOS (2015 - 2016)](https://openrepos.net/content/cepiperez/flowplayer-0#content) started as a port of [FlowPlayer for MeeGo-Harmattan (2014)](https://openrepos.net/content/cepiperez/flowplayer#content). Both were solely written by [Matias Perez (CepiPerez)](https://github.com/CepiPerez). In 2021 Matias [released the source code of FlowPlayer](https://github.com/sailfishos-applications/flowplayer/commits/master?after=c4f36e1cb3a80b7c7b220a379c9bdaca3a300113+49) by creating this git repository at GitHub.

In 2023 [olf (Olf0)](https://github.com/Olf0) overhauled infrastructure aspects, such as this README, a [new OpenRepos page](https://openrepos.net/content/olf/flowplayer#content), the [Transifex integration](https://github.com/sailfishos-applications/flowplayer/pull/7), making the spec file suitable for [the Sailfish-OBS](https://build.sailfishos.org/) and [the SailfishOS:Chum community repository](https://build.sailfishos.org/project/show/sailfishos:chum) etc.
In 2023 [olf (Olf0)](https://github.com/Olf0) overhauled infrastructure aspects, such as this README, a [new OpenRepos page](https://openrepos.net/content/olf/flowplayer#content), the [Transifex integration](https://github.com/sailfishos-applications/flowplayer/pull/7), making the spec file suitable for [the SailfishOS-OBS](https://build.sailfishos.org/) and [the SailfishOS:Chum community repository](https://github.com/sailfishos-chum/main/blob/main/Metadata.md) etc.

<br />

Expand All @@ -46,6 +47,7 @@ In 2023 [olf (Olf0)](https://github.com/Olf0) overhauled infrastructure aspects,
#### Contributors
- [Damien Caliste (dcaliste)](https://github.com/dcaliste)
- [David Llewellyn-Jones (llewelld / flypig)](https://github.com/llewelld)
- [Mark Washeim (poetaster)](https://github.com/poetaster)
- [olf (Olf0)](https://github.com/Olf0)
- [Ruben de Smet (rubdos)](https://github.com/rubdos)
- [Tomasz Sterna (smokku)](https://github.com/smokku)
Expand Down
3 changes: 2 additions & 1 deletion qml/pages/AboutPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ Page {
"(C) 2023, 2024 Damien Caliste (dcaliste)" + "<br />" +
"(C) 2024 Tomasz Sterna (smokku)" + "<br />" +
"(C) 2024 David Llewellyn-Jones (llewelld / flypig)" + "<br />" +
"(C) 2024 Ruben de Smet (rubdos)"
"(C) 2024 Ruben de Smet (rubdos)" + "<br />" +
"(C) 2024 Mark Washeim (poetaster)"
font.pixelSize: Theme.fontSizeSmall
}

Expand Down
2 changes: 1 addition & 1 deletion qml/pages/FullAlbumSearch.qml
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ Page {
ViewPlaceholder {
enabled: songlist.count===0 && loaded
Behavior on opacity { FadeAnimation {} }
text: qsTr("There's no missing covers in your music collection")
text: qsTr("There are no missing covers in your music collection")
}

}
Expand Down
6 changes: 5 additions & 1 deletion rpm/flowplayer.changes
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
* Wed Feb 28 2024 olf <[email protected]> - 0.3.4
* Fri Mar 15 2024 olf <[email protected]> - 0.3.5
-

* Thu Mar 14 2024 olf <[email protected]> - 0.3.4
- Support Opus codec (#67) by @rubdos
- Add local cover art when importing tracks (#75) by @poetaster with contributions by @dcaliste and @Olf0

* Mon Feb 26 2024 olf <[email protected]> - 0.3.3
- Slightly overhaul `AboutPage.qml` (#58, #59)
- Avoid creating QSettings too early (#65, #69) by @llewelld & @dcaliste, closes issues #63 & #64
Expand Down
6 changes: 3 additions & 3 deletions rpm/flowplayer.spec
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Name: flowplayer
Summary: Music Player for SailfishOS
# The <version> tag must adhere to semantic versioning: Among multiple other
# reasons due to its use for `qmake5` in line 104. See https://semver.org/
Version: 0.3.4
Version: 0.3.5
# The <release> tag comprises one of {alpha,beta,rc,release} postfixed with a
# natural number greater or equal to 1 (e.g., "beta3") and may additionally be
# postfixed with a plus character ("+"), the name of the packager and a release
Expand All @@ -21,7 +21,7 @@ Version: 0.3.4
# build at GitHub and OBS, when configured accordingly; mind the sorting
# (`adud` < `alpha`). For details and reasons, see
# https://github.com/storeman-developers/harbour-storeman/wiki/Git-tag-format
Release: release2
Release: release3
# The Group tag should comprise one of the groups listed here:
# https://github.com/mer-tools/spectacle/blob/master/data/GROUPS
Group: Applications/Multimedia
Expand Down Expand Up @@ -74,7 +74,7 @@ Categories:
- Player
- Qt
- Viewer
DeveloperName: CepiPerez, olf, dcaliste, smokku, flypig, rubdos
DeveloperName: CepiPerez, olf, dcaliste, smokku, flypig, rubdos, poetaster
Custom:
Repo: %{url}
PackageIcon: %{url}/raw/master/flowplayer.png
Expand Down
3 changes: 3 additions & 0 deletions src/FlowPlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ int main(int argc, char *argv[])

app->installTranslator(&translator);

// ensure the media cache dir is created
const QString mediaCacheDir = QStandardPaths::writableLocation(QStandardPaths::CacheLocation) + "/media-art";
QDir().mkpath(mediaCacheDir);

QScopedPointer<QQuickView> window(SailfishApp::createView());
window->setTitle("FlowPlayer");
Expand Down
2 changes: 1 addition & 1 deletion src/coversearch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ void CoverSearch::paintImg(QString image, int index)

void CoverSearch::saveImage(QString artist, QString album, QString imagepath)
{
QString th2 = QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation) + "/media-art/album-"+ doubleHash(artist, album) + ".jpeg";
QString th2 = QStandardPaths::writableLocation(QStandardPaths::CacheLocation) + "/media-art/album-"+ doubleHash(artist, album) + ".jpeg";

QImage image(imagepath);
image.save(th2, "JPEG");
Expand Down
31 changes: 31 additions & 0 deletions src/datareader.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "datareader.h"
#include "globalutils.h"

#include <mpegfile.h>
#include <flacfile.h>
Expand All @@ -25,6 +26,7 @@
#include <QStringList>
#include <QSettings>
#include <QDebug>
#include <QStandardPaths>

extern bool databaseWorking;
extern bool isDBOpened;
Expand Down Expand Up @@ -185,6 +187,10 @@ TagLib::File* DataReader::getFileByMimeType(QString file)

void DataReader::readFile(QString file)
{
// Is oFile used somewhere? (I failed to find a location.)
// If not, what is this new line good for? For details, see PR #75.
QString oFile = file;

file.remove("file://");
TagLib::File* tf = getFileByMimeType(file);

Expand All @@ -202,6 +208,31 @@ void DataReader::readFile(QString file)
m_tracknum = QString::number(tagFile->tag()->track());

if (m_title=="") m_title = QFileInfo(file).baseName();

// if we have artist and album, we check for a cover image.
if (m_artist != "" && m_album != "") {
QFileInfo info(file);
QDirIterator iterator(info.dir());
while (iterator.hasNext()) {
iterator.next();
// we are explicit about two common factors, the type JPEG (ToDo: add PNG
// throughout all C++ source files, see issue #78), and basename cover or folder
if (iterator.fileInfo().isFile()) {
if ( (iterator.fileInfo().suffix() == "jpeg" ||
iterator.fileInfo().suffix() == "jpg") &&
// See ToDo above: (… ||
// iterator.fileInfo().suffix() == "png") &&
(iterator.fileInfo().baseName() == "cover" ||
iterator.fileInfo().baseName() == "folder") ) {
QString th2 = QStandardPaths::writableLocation(QStandardPaths::CacheLocation) +
"/media-art/album-" + doubleHash(m_artist, m_album) + ".jpeg";
qDebug() << "COPYING FILE ART: " << iterator.filePath() << m_artist << m_album;
QFile::copy(iterator.filePath(), th2);
}
}
}
}

if (m_artist=="") m_artist = tr("Unknown artist");
if (m_album=="") m_album = tr("Unknown album");

Expand Down
4 changes: 2 additions & 2 deletions src/datos.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ bool namefileLessThan(const QStringList &d1, const QStringList &d2)

QString Datos::getThumbnail(QString data, int index)
{
QString th1 = QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation) + "/media-art/album-"+ data + ".jpeg";
QString th1 = QStandardPaths::writableLocation(QStandardPaths::CacheLocation) + "/media-art/album-"+ data + ".jpeg";

/*QString th2 = QStandardPaths::writableLocation(QStandardPaths::CacheLocation) + "/flowplayer/62/album-"+ data + ".jpeg";
Expand Down Expand Up @@ -320,7 +320,7 @@ void Datos::DatosPrivate::populateItems()
item->band = q->listado[i][3];
item->songs = q->listado[i][4];
item->hash = doubleHash(item->acount=="1"? item->artist : item->title, item->title);
item->coverart = QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation) + "/media-art/album-"+ item->hash + ".jpeg";
item->coverart = QStandardPaths::writableLocation(QStandardPaths::CacheLocation) + "/media-art/album-"+ item->hash + ".jpeg";
item->isSelected = false;
} else if (groupFilter=="artist") {
item->artist = q->listado[i][1]=="1"? tr("1 album") : tr("%1 albums").arg( q->listado[i][1].toInt());
Expand Down
16 changes: 8 additions & 8 deletions src/loadwebimage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ bool WebThread::checkInternal()

if (QFileInfo(dir + "/folder.jpg").exists())
{
QString th2 = QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation) + "/media-art/album-"+ doubleHash(artist, album) + ".jpeg";
QString th2 = QStandardPaths::writableLocation(QStandardPaths::CacheLocation) + "/media-art/album-"+ doubleHash(artist, album) + ".jpeg";
QImage image(dir + "/folder.jpg");
image.save(th2, "JPEG");
emit imgLoaded(th2, files[0][2].toInt());
Expand All @@ -89,7 +89,7 @@ bool WebThread::checkInternal()

else if (QFileInfo(dir + "/folder.jpeg").exists())
{
QString th2 = QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation) + "/media-art/album-"+ doubleHash(artist, album) + ".jpeg";
QString th2 = QStandardPaths::writableLocation(QStandardPaths::CacheLocation) + "/media-art/album-"+ doubleHash(artist, album) + ".jpeg";
QImage image(dir + "/folder.jpeg");
image.save(th2, "JPEG");
emit imgLoaded(th2, files[0][2].toInt());
Expand All @@ -98,7 +98,7 @@ bool WebThread::checkInternal()

else if (QFileInfo(dir + "/cover.jpg").exists())
{
QString th2 = QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation) + "/media-art/album-"+ doubleHash(artist, album) + ".jpeg";
QString th2 = QStandardPaths::writableLocation(QStandardPaths::CacheLocation) + "/media-art/album-"+ doubleHash(artist, album) + ".jpeg";
QImage image(dir + "/cover.jpg");
image.save(th2, "JPEG");
emit imgLoaded(th2, files[0][2].toInt());
Expand All @@ -107,7 +107,7 @@ bool WebThread::checkInternal()

if (QFileInfo(dir + "/Folder.jpg").exists())
{
QString th2 = QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation) + "/media-art/album-"+ doubleHash(artist, album) + ".jpeg";
QString th2 = QStandardPaths::writableLocation(QStandardPaths::CacheLocation) + "/media-art/album-"+ doubleHash(artist, album) + ".jpeg";
QImage image(dir + "/Folder.jpg");
image.save(th2, "JPEG");
emit imgLoaded(th2, files[0][2].toInt());
Expand All @@ -116,7 +116,7 @@ bool WebThread::checkInternal()

else if (QFileInfo(dir + "/Folder.jpeg").exists())
{
QString th2 = QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation) + "/media-art/album-"+ doubleHash(artist, album) + ".jpeg";
QString th2 = QStandardPaths::writableLocation(QStandardPaths::CacheLocation) + "/media-art/album-"+ doubleHash(artist, album) + ".jpeg";
QImage image(dir + "/Folder.jpeg");
image.save(th2, "JPEG");
emit imgLoaded(th2, files[0][2].toInt());
Expand All @@ -125,7 +125,7 @@ bool WebThread::checkInternal()

else if (QFileInfo(dir + "/Cover.jpg").exists())
{
QString th2 = QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation) + "/media-art/album-"+ doubleHash(artist, album) + ".jpeg";
QString th2 = QStandardPaths::writableLocation(QStandardPaths::CacheLocation) + "/media-art/album-"+ doubleHash(artist, album) + ".jpeg";
QImage image(dir + "/Cover.jpg");
image.save(th2, "JPEG");
emit imgLoaded(th2, files[0][2].toInt());
Expand Down Expand Up @@ -292,7 +292,7 @@ QString WebThread::saveToDisk(QIODevice *reply)

QString art = files[0][0];
QString alb = files[0][1];
QString th2 = QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation) + "/media-art/album-"+ doubleHash(art, alb) + ".jpeg";
QString th2 = QStandardPaths::writableLocation(QStandardPaths::CacheLocation) + "/media-art/album-"+ doubleHash(art, alb) + ".jpeg";

QImage image = QImage::fromData(reply->readAll());
image.save(th2, "JPEG");
Expand All @@ -304,7 +304,7 @@ QString WebThread::saveToDiskExtern(QIODevice *reply)
{
QImage image = QImage::fromData(reply->readAll());

QString path = QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation) + "/flowplayer/" + hash(curImage) + ".jpeg";
QString path = QStandardPaths::writableLocation(QStandardPaths::CacheLocation) + "/flowplayer/" + hash(curImage) + ".jpeg";

image.save(path, "JPEG");

Expand Down
4 changes: 2 additions & 2 deletions src/missing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@ void Missing::loadData()

if (dato1!=tr("Unknown album") && dato2!=tr("Unknown artist"))
{
QString th2 = QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation) + "/media-art/album-"+ doubleHash(dato2, dato1) + ".jpeg";
QString th2 = QStandardPaths::writableLocation(QStandardPaths::CacheLocation) + "/media-art/album-"+ doubleHash(dato2, dato1) + ".jpeg";
if ( ! QFileInfo(th2).exists() )
{
QString th3 = QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation) + "/media-art/album-"+ doubleHash(dato1, dato1); + ".jpeg";
QString th3 = QStandardPaths::writableLocation(QStandardPaths::CacheLocation) + "/media-art/album-"+ doubleHash(dato1, dato1); + ".jpeg";
if ( ! QFileInfo(th3).exists() )
{
//qDebug() << dato1 << " doesn't exist. Adding to list";
Expand Down
Loading

0 comments on commit cc334f1

Please sign in to comment.