Skip to content

Commit

Permalink
Merge pull request #53 from sailfishos-applications/devel
Browse files Browse the repository at this point in the history
`devel`→`master`: commits for v0.3.2
  • Loading branch information
Olf0 authored Feb 9, 2024
2 parents 885302c + d1f246b commit 81194ca
Show file tree
Hide file tree
Showing 26 changed files with 200 additions and 79 deletions.
1 change: 1 addition & 0 deletions FlowPlayer.pro
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ OTHER_FILES += \
qml/pages/SongsPage.qml \
qml/pages/ManageFolders.qml \
qml/pages/AddFolder.qml \
qml/pages/PickFolder.qml \
qml/pages/AboutPage.qml \
qml/pages/SelectPreset.qml \
qml/pages/LastFM.qml \
Expand Down
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,22 @@

**FlowPlayer is a music player with lyrics support, online radio and 10-band equalizer.**

Features:
<br />

#### Features:
- *<ToDo: 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.>*

<sup>Note that the ability to ... may be broken (this is [known for XXX](https://github.com/sailfishos-applications/flowplayer/issues/) ‒ currently nothing) due to API changes in recent SailfishOS releases.</sup><br />
Pull requests with fixes, improvements and enhancements are welcome!

<br />

## Translating FlowPlayer (l10n / i18n)

If you want to translate FlowPlayer to a language it does not support yet or improve an extant translation, please [read the translations-README](./translations#readme).

<br />

## Screenshots of FlowPlayer

| | | | |
Expand All @@ -24,19 +30,22 @@ If you want to translate FlowPlayer to a language it does not support yet or imp
| ![Covers by artist](./.xdata/screenshots/screenshot-20150711134206.jpg?raw=true) | ![Playlists](./.xdata/screenshots/screenshot-20150711134443.jpg?raw=true) | ![FileCase's cover](./.xdata/screenshots/screenshot-20150711134615.jpg?raw=true) | ![Lyrics](./.xdata/screenshots/screenshot-20150701221204.jpg?raw=true)
| &nbsp;&nbsp;Covers&nbsp;by&nbsp;artist&nbsp;&nbsp;&nbsp; | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Playlists&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | FlowPlayer's&nbsp;cover | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Lyrics&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |
| | | | |
<br />

## History of FlowPlayer

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.

<br />

## Credits
#### Original author
[Matias Perez (CepiPerez)](https://github.com/CepiPerez)
#### Contributors
- [olf (Olf0)](https://github.com/Olf0)
- [Damien Caliste (dcaliste)](https://github.com/dcaliste)
- [olf (Olf0)](https://github.com/Olf0)
<br />

### License: [MPL 2.0](https://spdx.org/licenses/MPL-2.0-no-copyleft-exception.html)
Expand Down
38 changes: 25 additions & 13 deletions qml/pages/AboutPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Page {
spacing: Theme.paddingLarge

Image {
source: "file://usr/share/icons/hicolor/86x86/apps/flowplayer.png"
source: "file:///usr/share/icons/hicolor/86x86/apps/flowplayer.png"
}

Column {
Expand All @@ -58,7 +58,13 @@ Page {

Label {
color: Theme.secondaryColor
text: "(C) 2015-2016 Matias Perez (CepiPerez)"
text: qsTr("Original author:")
font.pixelSize: Theme.fontSizeSmall
}

Label {
color: Theme.secondaryColor
text: "(C) 2015-2021 Matias Perez (CepiPerez)"
font.pixelSize: Theme.fontSizeSmall
}

Expand All @@ -68,19 +74,26 @@ Page {
}

Label {
text: colored + qsTr("Taglib is used for reading, writing and manipulating audio file tags") +
"<br><a href='https://taglib.github.io/'>taglib.github.io</a>"
onLinkActivated: Qt.openUrlExternally(link)
color: Theme.secondaryColor
text: qsTr("Contributors:")
font.pixelSize: Theme.fontSizeSmall
textFormat: Text.RichText
wrapMode: Text.WordWrap
}

Label {
color: Theme.secondaryColor
text: "(C) 2022-2024 olf (Olf0)" + "<br />" +
"(C) 2023-2024 Damien Caliste (dcaliste)"
font.pixelSize: Theme.fontSizeSmall
}

Separator {
width: parent.width
color: Theme.secondaryColor
}

Label {
text: colored + qsTr("If your language is not available you can contribute here:") + "<br>" +
"<a href='https://www.transifex.com/projects/p/flowplayer/'>" +
"www.transifex.com/projects/p/flowplayer</a>"
text: colored + qsTr("If you want to create a new translation or improve an extant one:") + "<br>" +
"<a href='https://app.transifex.com/olf/flowplayer/'>" + "Transifex - FlowPlayer</a>"
onLinkActivated: Qt.openUrlExternally(link)
font.pixelSize: Theme.fontSizeSmall
textFormat: Text.RichText
Expand All @@ -94,15 +107,15 @@ Page {
}

Label {
text: colored + qsTr("You can contribute to keep this project alive making a small donation")
text: colored + qsTr("You can support the original author of FlowPlayer by donating:")
font.pixelSize: Theme.fontSizeSmall
textFormat: Text.RichText
wrapMode: Text.WordWrap
width: parent.width
}

Image {
source: "../paypal.png"
source: "file:///usr/share/flowplayer/icons/paypal.png"
height: Theme.itemSizeMedium
fillMode: Image.PreserveAspectFit
smooth: true
Expand All @@ -117,5 +130,4 @@ Page {

}


}
2 changes: 1 addition & 1 deletion qml/pages/AddFolder.qml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Dialog {
onAppendFilesDone: currentPath = path
}

property string currentPath: "/home/nemo"
property string currentPath

DialogHeader {
id: header
Expand Down
2 changes: 1 addition & 1 deletion qml/pages/AlbumListView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ Page {
onClicked: {
helperList.clear()
myplaylistmanager.loadAlbum(model.artist, model.album, "1")
meta.setFile(decodeURIComponent(helperList.get(0).url))
meta.setFile(helperList.get(0).url)
helperList2.clear()
for ( var i=0; i<helperList.count; ++i )
helperList2.append(helperList.get(i))
Expand Down
2 changes: 1 addition & 1 deletion qml/pages/AlbumMetadata.qml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Dialog {
//meta.setData(titleField.text, artistField.text, albumField.text, yearField.text)
for ( var i=0; i<helperList2.count; ++i )
{
meta.setFile(decodeURIComponent(helperList2.get(i).url),"false")
meta.setFile(helperList2.get(i).url,"false")
console.log("TAG: " + artistField.text + " - " + albumField.text + " - " + yearField.text)
meta.setAlbumData(artistField.text, albumField.text, yearField.text)
}
Expand Down
2 changes: 1 addition & 1 deletion qml/pages/ManageFolders.qml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Page {
PullDownMenu {
MenuItem {
text: qsTr("Add folder")
onClicked: pageStack.push("AddFolder.qml")
onClicked: pageStack.push(hasPickers ? "PickFolder.qml" : "AddFolder.qml")
}
}

Expand Down
2 changes: 1 addition & 1 deletion qml/pages/NowPlaying.qml
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ Page {
nppOpened = true
helperList2.clear()
helperList2.append({"url":bigCoverList.currentItem.myData.url})
meta.setFile(decodeURIComponent(helperList2.get(0).url))
meta.setFile(helperList2.get(0).url)
pageStack.push ("Metadata.qml", {"artist":bigCoverList.currentItem.myData.artist,
"album":bigCoverList.currentItem.myData.album,
"title":bigCoverList.currentItem.myData.title
Expand Down
12 changes: 12 additions & 0 deletions qml/pages/PickFolder.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import QtQuick 2.0
import Sailfish.Silica 1.0
import Sailfish.Pickers 1.0
import FlowPlayer 1.0

FolderPickerPage {
dialogTitle: qsTr("Select folder")
showSystemFiles: false
onSelectedPathChanged: {
utils.addFolderToList(selectedPath)
}
}
2 changes: 1 addition & 1 deletion qml/pages/SongsPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ Page {
text: qsTr("Edit metadata")
onClicked: {
console.log("METADATA: " + model.url)
meta.setFile(decodeURIComponent(model.url))
meta.setFile(model.url)
pageStack.push ("Metadata.qml", {"artist": model.artist,
"album": model.album,
"title": model.title
Expand Down
15 changes: 11 additions & 4 deletions rpm/flowplayer.changes
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
* Sat Feb 03 2024 olf <[email protected]> - 0.3.1
- Add missing QML dependencies (PRs #27, #28)
- Fix various ways of album cover download (PR #31) by @dcaliste (closes issue #30)
- Use version number from the RPM spec file (PR #32) by @dcaliste (closes issue #29)
* Wed Feb 08 2024 olf <[email protected]> - 0.3.2
- Enhance AboutPage.qml (#37, #44)
- Translation updates for DE & SV (#45, #46)
- Try harder to get rid of hardcoded home paths (#48)
- Change the organisation name (#51)

* Sun Feb 04 2024 olf <[email protected]> - 0.3.1
- Add missing QML dependencies (#27, #28)
- Fix various ways of album cover download (#31) by @dcaliste (closes issue #30)
- Use version number from the RPM spec file (#32) by @dcaliste (closes issue #29)
- Fix building at SFOS-OBS (#40), closes issue #39

* Tue Dec 05 2023 olf <[email protected]> - 0.3.0
- Create README
Expand Down
4 changes: 2 additions & 2 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.1
Version: 0.3.2
# 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.1
# 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: rc3
Release: rc4
# 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
68 changes: 66 additions & 2 deletions src/FlowPlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,78 @@
bool isDBOpened;
bool databaseWorking;

static void migrateSettings()
{
const QString oldSettings = QStandardPaths::writableLocation(QStandardPaths::ConfigLocation) + "/cepiperez/flowplayer.conf";
const QString newSettings = QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation) + ".conf";
if (QFile::exists(oldSettings)) {
if (QDir().mkpath(QFileInfo(newSettings).path())
&& !QFile::rename(oldSettings, newSettings)) {
qWarning() << "unable to move old configuration from" << oldSettings << "to" << newSettings;
}
QDir(QStandardPaths::writableLocation(QStandardPaths::ConfigLocation)).rmdir("cepiperez");
}
}

static void migrateDatabase()
{
const QString olderDb = QStandardPaths::writableLocation(QStandardPaths::ConfigLocation) + "/cepiperez/flowplayer.db";
const QString oldDb = QStandardPaths::writableLocation(QStandardPaths::ConfigLocation) + "/flowplayer/flowplayer/flowplayer.db";
const QString newDb = QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation) + "/flowplayer.db";
if (QFile::exists(oldDb)) {
if (QDir().mkpath(QFileInfo(newDb).path())
&& !QFile::rename(oldDb, newDb)) {
qWarning() << "unable to move old database from" << oldDb << "to" << newDb;
}
QDir(QStandardPaths::writableLocation(QStandardPaths::ConfigLocation) + "/flowplayer").rmdir("flowplayer");
QDir(QStandardPaths::writableLocation(QStandardPaths::ConfigLocation)).rmdir("flowplayer");
} else if (QFile::exists(olderDb)) {
if (QDir().mkpath(QFileInfo(newDb).path())
&& !QFile::rename(olderDb, newDb)) {
qWarning() << "unable to move old database from" << olderDb << "to" << newDb;
}
QDir(QStandardPaths::writableLocation(QStandardPaths::ConfigLocation)).rmdir("cepiperez");
}
}

static void migrateCache()
{
const QString olderCache = QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation) + "/flowplayer";
const QString oldCache = QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation) + "/flowplayer/flowplayer";
const QString newCache = QStandardPaths::writableLocation(QStandardPaths::CacheLocation);
if (QFileInfo(oldCache).isDir()) {
if (QDir().mkpath(QFileInfo(newCache).path())
&& !QDir().rename(oldCache, newCache)) {
qWarning() << "unable to move old cache from" << oldCache << "to" << newCache;
}
QDir(QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation) + "/flowplayer").rmdir("flowplayer");
QDir(QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation)).rmdir("flowplayer");
} else if (QFileInfo(olderCache).isDir()) {
if (QDir().mkpath(QFileInfo(newCache).path())
&& !QDir().rename(olderCache, newCache)) {
qWarning() << "unable to move old cache from" << olderCache << "to" << newCache;
}
QDir(QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation)).rmdir("flowplayer");
}
}

int main(int argc, char *argv[])
{
QTextCodec *linuxCodec = QTextCodec::codecForName("UTF-8");
QTextCodec::setCodecForLocale(linuxCodec);

QGuiApplication *app = SailfishApp::application(argc, argv);
app->setOrganizationName("flowplayer");
app->setOrganizationName("sailfishos-applications");
app->setApplicationName("flowplayer");

migrateSettings();
migrateDatabase();
migrateCache();

QString lang;
QTranslator translator;

QSettings settings("cepiperez", "flowplayer");
QSettings settings;
lang = settings.value("Language", "undefined").toString();

if (lang=="undefined")
Expand All @@ -60,6 +119,11 @@ int main(int argc, char *argv[])

window->engine()->addImportPath("/usr/share/flowplayer/qml");
window->rootContext()->setContextProperty("appVersion", VERSION);
bool hasPickers = false;
for (const QString &path : window->engine()->importPathList()) {
hasPickers = hasPickers || QFile::exists(path + "/Sailfish/Pickers");
}
window->rootContext()->setContextProperty("hasPickers", hasPickers);

qmlRegisterType<Utils>("FlowPlayer", 1, 0, "Utils");
qmlRegisterType<CoverSearch>("FlowPlayer", 1, 0, "CoverSearch");
Expand Down
2 changes: 1 addition & 1 deletion src/coversearch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ void CoverSearch::remove(const QString &file)
QString nf = file;
if ( nf.startsWith("//") )
nf.remove(0, 1);
QSettings settings("cepiperez", "flowplayer");
QSettings settings;
QStringList entries = settings.value("CoverSearch","").toStringList();
QStringList newfiles;
for (int i=0; i< entries.count(); ++i)
Expand Down
2 changes: 1 addition & 1 deletion src/datareader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ void DataReader::run()
favFiles.clear();
map.clear();

QSettings settings("cepiperez", "flowplayer");
QSettings settings;
QStringList folders = settings.value("Folders","").toString().split("<separator>");
folders.removeAll("");

Expand Down
6 changes: 3 additions & 3 deletions src/datos.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ void Datos::addFilterToQueue()
}*/

QString norder;
QSettings settings("cepiperez", "flowplayer");
QSettings settings;
QString order = settings.value("TrackOrder", "title").toString();

if (order=="title") norder="title";
Expand Down Expand Up @@ -429,7 +429,7 @@ QString Datos::getArtistsCovers()
dato1.append(coverart);
}

QSettings settings("cepiperez", "flowplayer");
QSettings settings;
int first = settings.value("LastArtistItem", 0).toInt();

if (first >= dato1.count()) {
Expand Down Expand Up @@ -463,7 +463,7 @@ QString Datos::getAlbumsCovers()
dato1.append(coverart);
}

QSettings settings("cepiperez", "flowplayer");
QSettings settings;
int first = settings.value("LastAlbumItem", 0).toInt();

if (first >= dato1.count()) {
Expand Down
Loading

0 comments on commit 81194ca

Please sign in to comment.