Skip to content

Commit

Permalink
develmaster: Changeset for v0.3.4 (#84)
Browse files Browse the repository at this point in the history
* Post-release version increase (#71)

* [flowplayer.spec] Post-release version increase

* [flowplayer.changes] Add stub for v0.3.4

* [flowplayer.changes] Add closure of issue #63 by #65

* Try and implement Opus (#67)

* Add Ruben de Smet (rubdos) as contributor (#73)

* [flowplayer.spec] Add Ruben de Smet (rubdos)

* [README.md] Add Ruben de Smet (rubdos)

* [AboutPage.qml] Add Ruben de Smet (rubdos)

* [LICENSE.txt] Add Ruben de Smet (rubdos)

* Add Mark Washeim (poetaster) to contributors (#81)

* [README.md] Add Mark Washeim (poetaster) to contributors

* [AboutPage.qml] Add Mark Washeim (poetaster) to contributors

* [LICENSE.txt] Add Mark Washeim (poetaster) to contributors

* [flowplayer.spec] Add poetaster to developers list

* [flowplayer.changes] Update for release of v0.3.4

* [Feature] Add local cover art when importing tracks (#75)

* [Feature] add initial addition for cover art if a jpg is found in the directory as tracks are added to the db. also, correct old Generic paths, and test with sailjail.

* PR: feedback integrated: 1. alternate logic for applying folder/cover image copy, basename check. 2. remove media indexing sailjail perms, 3. move cache dir creation from migrate to main

* [FlowPlayer.cpp] Improve style as suggested by @dcaliste

* [datareader.cpp] Improve style as suggested by @dcaliste

* [flowplayer.desktop] Omit SailJail sandboxing configuration for now

* [datareader.cpp] Improve style as suggested by @dcaliste

* Review: remove png processing

* Update datareader.cpp
  remove unused QImage and png matching.

* Fix:logic of the || on png

* [datareader.cpp] Indention, no `jpg` & `png` for now, iterator reuse
  Addresses comments dispersed over PR #75's lengthy discussion.

* [datareader.cpp] Rectify comment

* [datareader.cpp] Improve comments & break long code line in two

* [datareader.cpp] Break two more long lines in two

* [datareader.cpp] Remove superfluous backslashes "\"

* [datareader.cpp] Omit superfluous space character " "

* [datareader.cpp] Extend comment

* Don't recurse in subdirs when looking for covers.

* [datareader.cpp] Insert comment and align with current TS files

---------

Co-authored-by: olf <[email protected]>
Co-authored-by: Damien Caliste <[email protected]>

* Translate translations/flowplayer.ts in de (#82)

100% translated source file: 'translations/flowplayer.ts'
on 'de'.

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>

* Translate translations/flowplayer.ts in sv (#83)

100% translated source file: 'translations/flowplayer.ts'
on 'sv'.

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>

---------

Co-authored-by: Ruben De Smet <[email protected]>
Co-authored-by: Mark Washeim <[email protected]>
Co-authored-by: Damien Caliste <[email protected]>
Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
  • Loading branch information
5 people authored Mar 14, 2024
2 parents 6390a33 + c0dab3c commit a4775ab
Show file tree
Hide file tree
Showing 24 changed files with 536 additions and 359 deletions.
4 changes: 4 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,10 @@ Accurate notices of copyright ownership:
- (C) 2015-2021 Matias Perez (CepiPerez) <[email protected]>
- (C) 2022-2024 olf (Olf0) <[email protected]>
- (C) 2023-2024 Damien Caliste (dcaliste) <[email protected]>
- (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
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ 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)
<br />

Expand Down
2 changes: 1 addition & 1 deletion qml/flowplayer.qml
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ ApplicationWindow
// Hard coded. FIXME: JB#22001.
desktopEntry: "jolla-mediaplayer"
supportedUriSchemes: ["file", "http", "https"]
supportedMimeTypes: ["audio/x-wav", "audio/mp4", "audio/mpeg", "audio/x-vorbis+ogg"]
supportedMimeTypes: ["audio/x-wav", "audio/mp4", "audio/mpeg", "audio/x-vorbis+ogg", "audio/ogg", "audio/opus"]

// Mpris2 Player Interface
canControl: currentSongInfo !== []
Expand Down
4 changes: 3 additions & 1 deletion qml/pages/AboutPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@ Page {
text: "(C) 2022-2024 olf (Olf0)" + "<br />" +
"(C) 2023, 2024 Damien Caliste (dcaliste)" + "<br />" +
"(C) 2024 Tomasz Sterna (smokku)" + "<br />" +
"(C) 2024 David Llewellyn-Jones (llewelld / flypig)"
"(C) 2024 David Llewellyn-Jones (llewelld / flypig)" + "<br />" +
"(C) 2024 Ruben de Smet (rubdos)" + "<br />" +
"(C) 2024 Mark Washeim (poetaster)"
font.pixelSize: Theme.fontSizeSmall
}

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 @@
* 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 issue #64
- Avoid creating QSettings too early (#65, #69) by @llewelld & @dcaliste, closes issues #63 & #64
- Let `TS`→`QM` file translation work on OBS (#68), fixes a common issue

* Thu Feb 08 2024 olf <[email protected]> - 0.3.2
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.3
Version: 0.3.4
# 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.3
# 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: release1
Release: release2
# 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
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 @@ -113,6 +113,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
35 changes: 35 additions & 0 deletions src/datareader.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
#include "datareader.h"
#include "globalutils.h"

#include <mpegfile.h>
#include <flacfile.h>
#include <tlist.h>
#include <vorbisfile.h>
#include <opusfile.h>
#include <mp4file.h>
#include <wavfile.h>
#include <speexfile.h>
Expand All @@ -24,6 +26,7 @@
#include <QStringList>
#include <QSettings>
#include <QDebug>
#include <QStandardPaths>

extern bool databaseWorking;
extern bool isDBOpened;
Expand Down Expand Up @@ -165,6 +168,8 @@ TagLib::File* DataReader::getFileByMimeType(QString file)
return new TagLib::FLAC::File(file.toUtf8());
} else if(str.endsWith(".ogg")) {
return new TagLib::Ogg::Vorbis::File(file.toUtf8());
} else if(str.endsWith(".opus")) {
return new TagLib::Ogg::Opus::File(file.toUtf8());
} else if(str.endsWith(".wav")) {
return new TagLib::RIFF::WAV::File(file.toUtf8());
} else if(str.endsWith(".m4a")) {
Expand All @@ -182,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 @@ -199,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 Expand Up @@ -252,6 +286,7 @@ void DataReader::run()
iterator.filePath().toLower().endsWith(".m4a") ||
iterator.filePath().toLower().endsWith(".flac") ||
iterator.filePath().toLower().endsWith(".ogg") ||
iterator.filePath().toLower().endsWith(".opus") ||
iterator.filePath().toLower().endsWith(".wma") ||
iterator.filePath().toLower().endsWith(".asg") ||
iterator.filePath().toLower().endsWith(".wav") )
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
3 changes: 3 additions & 0 deletions src/meta.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <flacfile.h>
#include <tlist.h>
#include <vorbisfile.h>
#include <opusfile.h>
#include <mp4file.h>
#include <wavfile.h>
#include <speexfile.h>
Expand Down Expand Up @@ -137,6 +138,8 @@ TagLib::File* Meta::getFileByMimeType(QString file)
return new TagLib::FLAC::File(file.toUtf8());
} else if(str.endsWith(".ogg")) {
return new TagLib::Ogg::Vorbis::File(file.toUtf8());
} else if(str.endsWith(".opus")) {
return new TagLib::Ogg::Opus::File(file.toUtf8());
} else if(str.endsWith(".wav")) {
return new TagLib::RIFF::WAV::File(file.toUtf8());
} else if(str.endsWith(".m4a")) {
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 a4775ab

Please sign in to comment.