-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature] Add local cover art when importing tracks #75
Conversation
… directory as tracks are added to the db. also, correct old Generic paths, and test with sailjail.
@poetaster, thank you very much for your contribution. P.S. / just whining: I start to understand why reviewers want a PR for each small coherent change. Never mind, this changeset (which comprises all three points in the description) is definitely not large. P.P.S.: Extra thanks for having performed an P.P.P.S.: BTW, what does "a proof of concept method" in point 3 of the PR description mean? I would understand that sentence well, if these four words are omitted, but fail to fully comprehend the complete sentence with them. Does this code block really constitute a "method"? Do you mean that this code block is just a "proof of concept" (it seems to be fully functional and do what it is supposed to do, or are you thinking about adding extra functionality to it later?)? |
It's a method which works as intended, but as a proof of concept. Which means that it needs more work. It's not much, but I didn't want to overload the PR :) What is missing:
|
O.K., so "method" in generic speak, but not as in "an object comprises a method and data" in OO-programming, correct?
Thank you, that is what I wanted to know. So we have as to-do list:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much @poetaster for the changes. I didn't have the opportunity to test yet. I will try next week. I have some suggestion on the current code, but it looks already quite good. Thanks again.
… image copy, basename check. 2. remove media indexing sailjail perms, 3. move cache dir creation from migrate to main
A method in the generic sense.
3, in the course of correcting vis. dcaliste's suggestions is done. |
BTW, by …
… I meant to imply "for later", not for this PR. IMHO the code additions are fine now, but @dcaliste has the concluding say on this. What I am still concerned about is the SailJail configuration per se (not its content), see review comment above. |
In the main, as with all migrations from pre to post sailjail, you have to choose a 'window' during which time the migration code is enabled and sailjail is not. I think (please correct me) that the users installing/using flowplayer now, are rarely in need of migrating the local database/cache (or are more than willing to just re-import). The PR I made here is making the bold assumption that the migration phase is finished. In any case, combining the changes while still using the old cache file patterns is not possible. So, this PR either waits for the conclusion of the 'migration phase' or we say, swallow the bitter pill and just enable sailjail and the small extra feature. The latter I could enhance (ie, I'd like artist pics) later. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @poetaster for the changes. I've got some style comments I forgot to mentioned last review, and a minor concern with the newly added code.
I think the new feature (and the new media-art location) can go in first when the PR is ready. Then, the code should be ready for sandboxing, and the |
Logically, but as already stated, I expect this "window" to comprise more than just a single release, which also was the first one not marked as "beta" or "RC".
I doubt the latter. Anyway, I depicted some routes above in the I could support some of these routes by creating an intermediate release soon, but would have to have an idea which route to take.
See above and for details the review comment. But I can assure you that we both, me and supposedly also @dcaliste want this PR in. |
I don't see a reason to extend the 'migration' window for more than one release. What reason do you see?
Since the flowplayer has only recently become available in a usable form, I don't see the foundation for your doubts?
It's very simple. The migration functions will no longer be able to read the files outside the scope of the declared namespaces once you deploy with sailjail. So, the copy from old namespace to new will simply fail.
will not work, since the ConfigLocation itself is now unrelated (that is, will be .../sailfishos-applications/flowplayer) and not reflect the old installation paths. But I went further and removed the old 'Generic' paths which were a 'bad idea(tm)' when they were originally implemented and certainly don't have anything to do with the migration code in the code base. That is to say: under no conditions would the migration code have found and moved the old album cover art cache files. So, it's a bit of a moot point. You need to rebuild the cache if we want to use sensible app defaults, namely, sailjail defaults.
Ok. I'm tight on time the next week or two. Having looked in some depth at the very pleasant and well built code base of unplayer, I had some ideas. But, as I say, I'm a bit tight on time. |
Although I understand an 'abundance of caution', I tested this in 'one go' since the major issue IS getting desktop standard cache/config/local storage. That just happens to conform with Sailjail which only 'enforces' the limit that you can't read outside. It's precisely because the Sailjail thing and the removal of paths like GenericCache coincide that I did them together. Next week, I could try to suggest a more formal test procedure which could allay fears that this is 'too much' in one PR . Some systematic tests. Ok? |
Social aspects first
Please @poetaster take your time: as much as you want or need. We are not in a hurry, this is spare time activity and should be (basically) fun. Do put this PR aside for a while, if it has become a stress factor for you. Please also respect, that I (IMHO this also applies to @dcaliste) do have to find the role to play here. I simply deployed the infrastructure changes to FlowPlayer which I originally had developed and applied to FileCase, because CepiPerez handed over both of his apps to me, hence I implicitly became a maintainer of it. But I did not plan to do much more, maybe handle some PRs by asking checks & balances questions; specifically I did not expect FlowPlayer to generate more interest than FileCase (a fundamentally incorrect assessment, as it turned out), which I am primarily interested in. Heck, I even do not use FlowPlayer at all, because I do not like to listen to music when being on the move. This PR has grown over my head, too, and made me occasionally consider to drop my maintainership. But I feel that this would be unfair to @dcaliste (and others, e.g. rubdos), who takes care about the hard-core technical aspects very well, only because I drag him into reviewing stuff by asking kindly, each time substantial changes to C++ or QML code are suggested. And I am actually very happy about his slightly nitpicking style, because I know how quickly code becomes deranged and hence hard to maintain, if one does not permanently care about quality much. OTOH, I am basically still willing to keep infrastructure work as release management, translations infrastructure and automatisation, CI workflows, GH repo config, RPM packaging, keeping READMEs up-to-date, etc. away from @dcaliste and other developers, including you @poetaster; I think this is a fair deal and qualifies me as primary maintainer, despite avoiding to deal with C++ and QML code. |
No stress, I'm stressed on other fronts so that carries over. In any case don't worry about the back and forth. So far I have made all the changes that @dcaliste has asked me to make and don't mind if the process involves more granular splits. I just don't have the muse to invest in nitpicking. But, let's let it settle. @dcaliste if you have a specific order of moves you'd like me to apply, please specify. Thanks for all your work! |
Technical stuff
Thanks, understood now, sorry for being too blind to see that late at night(s), when I have time for this. Consequently all three migration functions will fail when sandboxing is enabled. Then it does not make any sense to keep the migration functions as soon sandboxing is enabled. Thus I recur to asking to pose a separate PR, which employs the sandboxing configuration, which currently is part of this PR, and additionally deletes the three migration functions. Edit: Done, see PR #77. This will render this PR as a coherent set of changes and the new one, too. I will then "squash merge" this PR, hence @poetaster do not worry about the commits (order, content, whatever), because they will end up being applied to the Ultimately I consider to create a release between merging these two PRs, so we will have published two releases with the migration code, and you @poetaster get your new feature in its basic form published very soon.
While I would never contradict to extend testing, I suggest to leave this WRT workload. This is still Edit: I performed the trivial style changes as requested by @dcaliste, made a suggestion for the single non-trivial style change, and omitted the SailJail config, so @poetaster can focus on the things I am unable resolve. |
Originally developed by @poetaster and reviewed by @dcaliste in PR #75, see commits 68dc7f1 and fce86cd.
It occured to me yesterday evening that album covers are called everywhere in the code as a JPEG file, see:
Thus, copying a PNG file there will eventually fail without further modifications to the code. I suggest to leave this as an open question, and remove temporarily the PNG matching from this PR. Like that, @Olf0 can accept the PR which is already a huge improvement over the (non-)existing possibility of local covers. |
Or equivalently via GitHub's web-frontend: https://github.com/search?q=repo%3Asailfishos-applications%2Fflowplayer+path%3A%2F%5Esrc%5C%2F%2F+media-art%2Falbum&type=code
Yes please, as @dcaliste suggested:
Cover art in PNG format shall be addressed in a later PR (if somebody volunteers), because it requires further, intrusive changes, see first paragraph of this message. Please mind, that there are a two other open ToDos for you, see
|
If so (please state that clearly, or if you want changes, what exactly), I will resurrect this formatting, which was altered to the old formatting style in later commits. |
Addresses comments dispersed over PR sailfishos-applications#75's lengthy discussion.
@dcaliste, please review my final changes, comprising to omit the suffix "jpg" (because other code locations do not support it; see also issue #78) and some formatting changes: https://github.com/sailfishos-applications/flowplayer/pull/75/files/e40b96426a712b8c3bd3bd80e65a202f892bae21..72261f18e8cd6b9efb3099679eca4f5c8039ab6f Is the indention etc. fine now? Edit: Superseded, corrected and improved by @dcaliste via commit 73b543a. |
As @poetaster missed to reply to my unresolved comment WRT line 191 of |
From the ToDo list above I created issues #78, #79 and #80. |
I'm pushing an additional commit with some modifications. Please, disregard this commit if you think I'm wrong. I've tested the PR and I noticed the following:
So I've removed the recursing, but maybe this is addressing a case I didn't think about… I've an album which is not associated to a cover. Typically, an album with various artists. In that case, the cover is associated to |
Yes, I just understood that when looking through your changes.
Sure, it is already covered by issue #80. I plan to merge this in a couple of hours (towards midnight UTC) and then prepare a release. It is code, we can still change anything later, if necessary. |
I have to admit, I don't recall why! In any case, all of the file based cover art I have is located at the same level as the songs within (for album downloads). I'm guessing that I was over/under thinking it.
Thank you!
Yes, that's one I'm working on. It's a minefield. But flowplayer has a search (which sadly uses google apis) to allow you to deal with it. I was thinking of starting with at least checking if the tag data already contained binaries and then working from there. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Requested changes are all carried out, partially by @dcaliste himself.
* 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 <Olf0@users.noreply.github.com> Co-authored-by: Damien Caliste <dcaliste@free.fr> * 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 <ruben.de.smet@rubdos.be> Co-authored-by: Mark Washeim <blueprint@poetaster.de> Co-authored-by: Damien Caliste <dcaliste@free.fr> Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
* [flowplayer.desktop] Implement a proper SailJail configuration Originally developed by @poetaster and reviewed by @dcaliste in PR #75, see commits 68dc7f1 and fce86cd. * [FlowPlayer.cpp] Eliminate migration functions due to conflict with sandboxing
* Post release version increase to 0.3.5 (#85) * [flowplayer.spec] Post release version increase * [flowplayer.changes] Add stub for v0.3.5 * Update README.md * Translate translations/flowplayer.ts in et (#86) 100% translated source file: 'translations/flowplayer.ts' on 'et'. Co-authored-by: Priit Jõerüüt (tlend) via transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com> * [README.md] Add a feature * [README.md] Use better link * [README.md] Minimalistic wording improvement * Update README.md * Fixing a grammar error in FullAlbumSearch.qml (#88) Fixing a grammar error "there's no missing covers..." -> "there are no missing covers..." * Update utils.cpp (#87) Fixing a grammar error in several instances: "founded" -> "found" * Implement proper sandboxing (SailJail) configuration (#77) * [flowplayer.desktop] Implement a proper SailJail configuration Originally developed by @poetaster and reviewed by @dcaliste in PR #75, see commits 68dc7f1 and fce86cd. * [FlowPlayer.cpp] Eliminate migration functions due to conflict with sandboxing * [rpm/flowplayer.changes] Update for v0.3.5 * [CoverPage.qml] Fix string and run `lupdate` --------- Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com> Co-authored-by: tuplasuhveli <139926936+tuplasuhveli@users.noreply.github.com>
This PR contains 3 primary changes all related to obtaining local cover art, especially when cover art cannot be otherwise found.
GenericCacheLocation
use in favour of the application specificCacheLocation
.media-art
exists) and enforces its use with Sailjail.datareader.cpp
to check, if album and artist are known, if a file's containing directory contains a jpg/jpeg and if so, copy it to the album art cache.