Commit graph

2111 commits

Author SHA1 Message Date
Alexander Capehart
59280cc6d5
playback: standardize table names
Just let room pick the table names for PersistenceDatabase, instead of
using custom ones.

Reduces the amount of code in that part of the app.
2023-06-08 10:23:49 -06:00
Alexander Capehart
aaba858fcf
all: only use one fallback method for dbs
Only use fallbackToDestructiveMigration for all databases.

I thought you had to selectively enable downgrading as well, but
apparently that disables other destructive migrations. This was not
obvious at all and caused countless issues. Absolutely flooring.
2023-06-08 10:15:04 -06:00
Alexander Capehart
bce03a5833
playback: do not dynamically extract adjustments
Do not extract ReplayGain adjustments on the fly, instead doing them as
we go along.

This prevents an issue where the ReplayGain information would only be
applied a short period after playback start, which is heavily jarring.
2023-06-08 10:03:54 -06:00
Alexander Capehart
5ab46ba5d1
music: add userlibrary error returns
Make UserLibrary return some kind of error indicator if something
fails.

I don't have the framework for how the app will display these errors
just yet.
2023-06-07 20:10:07 -06:00
Alexander Capehart
a9a6d1ccc1
music: cleanup
Clean up parts of the music loader.
2023-06-07 20:08:57 -06:00
Alexander Capehart
77d01a0c97
home: use constant page limit
Use a constant page limit of 5 instead of a dynamic page limit.

This was not being properly updated prior, and since the ViewPager
already clamps it, the limit does not really need to be based on the
tab size anyway.
2023-06-07 20:07:06 -06:00
Alexander Capehart
8d97e86c8d
music: synchronize userlibrary value reads
Use synchronized when reading and writing values in UserLibrary.

Convention for all shared objects.
2023-06-07 19:40:31 -06:00
Alexander Capehart
07eefda67a
music: parallelize library creation
Make it so that the DeviceLibrary constructor streams all song
information instead of building the library on completion.

This has no measurable effect on loading times, but does appear visibly
faster to the user since the loading process is no longer stuck on the
"Loading your music library" step.
2023-06-07 19:32:22 -06:00
Alexander Capehart
8edfcd22c7
music: make grouping mechanism consistent
Actually bother to make the way music is grouped consistent, based on:
- The first track for albums
- The earliest album for artists
- The first song for genres
2023-06-07 15:15:51 -06:00
Alexander Capehart
927c4a056e
music: recognize (album)artistssort tags
Recognize albumartistssort and artistssort tags, which are apparently
written by beets.
2023-06-07 15:15:01 -06:00
Alexander Capehart
96874b3324
music: do not transfer cache db
Do not transfer the cache db between devices, drop it instead.

This is at best useless (timestamps and ids will be invalid) and at
worst actively detrimental (timestamps and ids are similar), so
better to reindex than try to read from the cache.

Resolves #467.
2023-06-07 09:43:17 -06:00
Alexander Capehart
55597e4976
ui: fix incorrectly aligned disc headers
Fix an issue where disc headers would be at the top when no subtitle as
available.

I really thought that TextView.text would be null if I set it to null.
Instead it becomes an empty string, breaking the visbility change. Fix
it by just using the disc value.

Resolves #472.
2023-06-07 09:23:16 -06:00
Alexander Capehart
6031fb2890
Merge pull request #465 from OxygenCobalt/dev
Version 3.1.1
2023-06-04 02:05:46 +00:00
Alexander Capehart
d49034b664
ui: fix back listener leak
Fix an issue where the OnBackPressedListeners would leak their bound
views once MainFragment's view was destroyed.
2023-06-03 09:24:45 -06:00
Alexander Capehart
736f3ec6b7
playback: fix crash on state restore
Fix a crash stemming from applying the playback state on the main
thread instead of the background thread.

all: add misc todos
2023-06-03 09:12:41 -06:00
Alexander Capehart
182883ef2d
music: avoid redundant devicelibrary comparison
Avoid redundantly comparing DeviceLibrary instances based on parent
information already derived from song instances.
2023-06-03 09:02:39 -06:00
Alexander Capehart
aae688b642
home: fix stuck playlist indicator
Fix an accidental return statement resulting in the playlist playback
indicator not properly updating if a song not in the playlist was
played.
2023-06-03 09:01:26 -06:00
Alexander Capehart
d786cd16d7
all: cleanup
Pre-release clean-up.
2023-06-02 17:25:59 -06:00
Alexander Capehart
c59074a4fe
build: bump to 3.1.1
Bump to version 3.1.1 (31).
2023-06-02 14:56:05 -06:00
Alexander Capehart
e150647573
playback: fix improper re-initializaiton
Fix issues stemming from how ExoPlayer apparently doesn't send a
playWhenReady event after being stopped.

This ended up breaking AudioEffect integration and notification
posting. I really don't know why player.stop() doesn't do this.
2023-06-02 14:47:14 -06:00
Alexander Capehart
e39d4d879c
ui: fix stuck sheet when playback ends
Fix an issue where the playback sheet will suddenly become "stuck" when
playback ends, preventing back navigation or playing new tracks.

This is, once again, caused by bottom sheet insanity. It does not
expose the target state of a sheet at all when it's settling, making
Auxio believe that it has to repeatedly "fix" the state of a hiding
playback sheet and leading to those aforementioned issues.

Fix this by band-aiding it with yet a n o t h e r bottom sheet behavior
extension that exposes the target state. This will be eventually be
used in the whole bottom sheet flow, as it allows me to abort
in-progress sheet transitions, but I'm not going to rock the boat like
this in a patch release. Probably 3.2.0.

Resolves #464.
2023-06-02 14:34:19 -06:00
Alexander Capehart
4581532928
queue: shift back if removing playing end
Shift the queue index backwards if the current song at the end of a
queue is removed.

Without this, the index becomes OOB and makes the queue be interpreted
as entirely empty when it actually isn't, which is compounded by a
remove-1 update intruction leading to a RecyclerView inconsistency
crash.
2023-06-02 13:34:00 -06:00
Alexander Capehart
df174e22f6
music: cache hashcode in data
Cache the hashcode of song/album/artist/genre information so that it
can be calculated easily later.
2023-06-01 20:46:56 -06:00
Alexander Capehart
0d28bdf99e
music: remove unnecessary documentation
Remove unnecessary function documentation for private methods in
DeviceLibrary.
2023-06-01 20:18:02 -06:00
Alexander Capehart
a37df594e7
music: fix song build bottleneck
Fix redundant separator parsing obliterating loading performance.

If there are no separators configured, the parsing function would not
short-circuit and instead do a useless O(n) iteraton (including
escaping!), massively reducing performance.

Song build performance still isn't the best (blame intelligent
sorting), but it's definitely better now.
2023-06-01 20:16:39 -06:00
Alexander Capehart
f9ccb831d8
music: fix comparison issues
Fix a few problems with the current comparison algorithm:
1. It wasn't actually comparing the raw music information, only the
UIDs, which was redundant.
2. The comparison in the main music loading process occurred on the
main thread, which causes massive freeze-up issues.

Resolves #457.
2023-06-01 15:10:24 -06:00
Alexander Capehart
46fb33de59
image: optimize grouping routine
Turns out the image grouping routine runs on the main thread and is
slow enough to cause massive freezing. Attempt to resolve this.
2023-06-01 12:39:19 -06:00
Alexander Capehart
5f70ce8870
build: drop api 21-23 support
Drop support for Lollipop and Marshmallow.

I legit cannot build for them anymore. There's some insane dependency
tangle between Kapt and Room that makes it impossible to use anything
BUT Java 17 (maybe Java 11). If I use Java 17 or Java 11, suddenly the
whole app crashes since Lollipop and Marshmallow only support some weird
Java 8/11 chimera abomination. This issue has persisted probably since
the move to Java 11, making it basically unusable anyway, so at this point
just cut the charade and officially drop support.
2023-06-01 10:52:44 -06:00
Alexander Capehart
5d51adfb0a
ui: split up back listeners
Split up the back gesture listeners into specific components.

These are still all used in MainFragment since I can't reliably set up
their priority correctly if they were used in their respective
fragments, but it should improve efficiency since most of these back
listeners don't need to be updated on every draw.
2023-05-30 17:10:32 -06:00
Alexander Capehart
841ea3620a
ui: fix incorrect back navigation
Fix the app incorrectly navigating away when a gesture accidentally
dragged one of the bottom sheets.
2023-05-29 11:50:44 -06:00
Alexander Capehart
40af4adc51
queue: use mdc drag handle
Use a real mdc drag handle on the queue sheet.

The accessibility functions won't even be enabled, but that
would need to be communicated in a special way anyway.
2023-05-29 10:38:49 -06:00
Alexander Capehart
d97eaf67b9
queue: fix visual error when adding to queue
Fix a visual error where adding to queue would visually place items
next to the starting index rather than at the end.

This was a result of forgetting to update the Add instructions returned
by Queue.addToNext to return the end of the queue rather than the
current index, which completely broke the queue visual.

Resolves #435.
2023-05-29 09:57:37 -06:00
Alexander Capehart
63f7627fbc
all: log listener additions
Log whenever a listener is added/removed.

This might make it easier to track concurrency issues stemming from
listener dispatch and addition occuring at the same time.
2023-05-29 09:24:06 -06:00
Alexander Capehart
bf40516ddd
build: update deps
ViewPager -> 1.1.0-beta02
Activity -> 1.7.2
2023-05-28 20:14:22 -06:00
Alexander Capehart
b93a512bf7
image: introduce sizing
Unify corner radius and icon size configurations under a new sizing
property. This is largely driven by a need to remove the typical
half-width icon sizing, as it results in blurry playing indicators
in some cases. This also co-incides with a change of parent image
icon sizes to 32dp over 28dp.

Resolves #415.
2023-05-28 20:00:52 -06:00
Alexander Capehart
47b791b95f
image: allow non-square album covers
Make the app UI properly handle album covers that are not 1:1, instead
of just cropping them.

This required switching to Coil's rounded corners transformation
outright so that the non-1:1 image can sit inside the CoverView in a
way that actually looks good

I'm pretty confident this will work, but there might be some edge cases
since coil's transformation is really finicky.

Resolves #355.
2023-05-28 19:05:42 -06:00
Alexander Capehart
770ae77eed
image: fix seam regression in coverview
Turns out that useless code from ImageGroup prevented a seam from
appearing when the playing indicator was shown. Re-add that,
albeit a bit less hacky.
2023-05-28 16:02:47 -06:00
Alexander Capehart
b7c15e0cc5
image: refactor views
Refactor StyledImageView and ImageGroup into a new class called
CoverView.

This new view is more sensibly designed and should be capable of
handling non-square album covers when implemented.
2023-05-28 15:29:38 -06:00
Alexander Capehart
10d05b1f26
all: fix log statements
Fix messy and useless log statements throughout the app.
2023-05-28 10:10:03 -06:00
Weblate (bot)
54724517ae
Translations update from Hosted Weblate (#449)
* Translated using Weblate (Chinese (Simplified))

Currently translated at 100.0% (276 of 276 strings)

Translation: Auxio/Strings
Translate-URL: https://hosted.weblate.org/projects/auxio/strings/zh_Hans/

* Translated using Weblate (Chinese (Simplified))

Currently translated at 100.0% (32 of 32 strings)

Translation: Auxio/Metadata
Translate-URL: https://hosted.weblate.org/projects/auxio/metadata/zh_Hans/

* Translated using Weblate (Czech)

Currently translated at 100.0% (275 of 275 strings)

Translation: Auxio/Strings
Translate-URL: https://hosted.weblate.org/projects/auxio/strings/cs/

* Translated using Weblate (Spanish)

Currently translated at 100.0% (275 of 275 strings)

Translation: Auxio/Strings
Translate-URL: https://hosted.weblate.org/projects/auxio/strings/es/

* Translated using Weblate (Italian)

Currently translated at 100.0% (275 of 275 strings)

Translation: Auxio/Strings
Translate-URL: https://hosted.weblate.org/projects/auxio/strings/it/

* Translated using Weblate (Ukrainian)

Currently translated at 100.0% (275 of 275 strings)

Translation: Auxio/Strings
Translate-URL: https://hosted.weblate.org/projects/auxio/strings/uk/

* Translated using Weblate (Czech)

Currently translated at 100.0% (32 of 32 strings)

Translation: Auxio/Metadata
Translate-URL: https://hosted.weblate.org/projects/auxio/metadata/cs/

* Translated using Weblate (Spanish)

Currently translated at 100.0% (32 of 32 strings)

Translation: Auxio/Metadata
Translate-URL: https://hosted.weblate.org/projects/auxio/metadata/es/

* Translated using Weblate (Italian)

Currently translated at 100.0% (32 of 32 strings)

Translation: Auxio/Metadata
Translate-URL: https://hosted.weblate.org/projects/auxio/metadata/it/

* Translated using Weblate (Ukrainian)

Currently translated at 100.0% (32 of 32 strings)

Translation: Auxio/Metadata
Translate-URL: https://hosted.weblate.org/projects/auxio/metadata/uk/

* Translated using Weblate (German)

Currently translated at 100.0% (275 of 275 strings)

Translation: Auxio/Strings
Translate-URL: https://hosted.weblate.org/projects/auxio/strings/de/

* Translated using Weblate (Hungarian)

Currently translated at 18.1% (50 of 275 strings)

Translation: Auxio/Strings
Translate-URL: https://hosted.weblate.org/projects/auxio/strings/hu/

* Translated using Weblate (Russian)

Currently translated at 100.0% (275 of 275 strings)

Translation: Auxio/Strings
Translate-URL: https://hosted.weblate.org/projects/auxio/strings/ru/

* Translated using Weblate (Russian)

Currently translated at 100.0% (275 of 275 strings)

Translation: Auxio/Strings
Translate-URL: https://hosted.weblate.org/projects/auxio/strings/ru/

* Translated using Weblate (Ukrainian)

Currently translated at 100.0% (275 of 275 strings)

Translation: Auxio/Strings
Translate-URL: https://hosted.weblate.org/projects/auxio/strings/uk/

* Translated using Weblate (German)

Currently translated at 100.0% (32 of 32 strings)

Translation: Auxio/Metadata
Translate-URL: https://hosted.weblate.org/projects/auxio/metadata/de/

* Translated using Weblate (Japanese)

Currently translated at 100.0% (275 of 275 strings)

Translation: Auxio/Strings
Translate-URL: https://hosted.weblate.org/projects/auxio/strings/ja/

* Translated using Weblate (Croatian)

Currently translated at 100.0% (275 of 275 strings)

Translation: Auxio/Strings
Translate-URL: https://hosted.weblate.org/projects/auxio/strings/hr/

* Translated using Weblate (Russian)

Currently translated at 100.0% (32 of 32 strings)

Translation: Auxio/Metadata
Translate-URL: https://hosted.weblate.org/projects/auxio/metadata/ru/

* Translated using Weblate (Belarusian)

Currently translated at 100.0% (275 of 275 strings)

Translation: Auxio/Strings
Translate-URL: https://hosted.weblate.org/projects/auxio/strings/be/

* Translated using Weblate (Czech)

Currently translated at 100.0% (279 of 279 strings)

Translation: Auxio/Strings
Translate-URL: https://hosted.weblate.org/projects/auxio/strings/cs/

* Translated using Weblate (German)

Currently translated at 100.0% (279 of 279 strings)

Translation: Auxio/Strings
Translate-URL: https://hosted.weblate.org/projects/auxio/strings/de/

* Translated using Weblate (Spanish)

Currently translated at 100.0% (279 of 279 strings)

Translation: Auxio/Strings
Translate-URL: https://hosted.weblate.org/projects/auxio/strings/es/

* Translated using Weblate (Korean)

Currently translated at 100.0% (279 of 279 strings)

Translation: Auxio/Strings
Translate-URL: https://hosted.weblate.org/projects/auxio/strings/ko/

* Translated using Weblate (Polish)

Currently translated at 100.0% (279 of 279 strings)

Translation: Auxio/Strings
Translate-URL: https://hosted.weblate.org/projects/auxio/strings/pl/

* Translated using Weblate (Russian)

Currently translated at 100.0% (279 of 279 strings)

Translation: Auxio/Strings
Translate-URL: https://hosted.weblate.org/projects/auxio/strings/ru/

* Translated using Weblate (Ukrainian)

Currently translated at 100.0% (279 of 279 strings)

Translation: Auxio/Strings
Translate-URL: https://hosted.weblate.org/projects/auxio/strings/uk/

* Translated using Weblate (Chinese (Simplified))

Currently translated at 100.0% (279 of 279 strings)

Translation: Auxio/Strings
Translate-URL: https://hosted.weblate.org/projects/auxio/strings/zh_Hans/

* Translated using Weblate (Japanese)

Currently translated at 100.0% (279 of 279 strings)

Translation: Auxio/Strings
Translate-URL: https://hosted.weblate.org/projects/auxio/strings/ja/

* Translated using Weblate (Lithuanian)

Currently translated at 100.0% (279 of 279 strings)

Translation: Auxio/Strings
Translate-URL: https://hosted.weblate.org/projects/auxio/strings/lt/

* Translated using Weblate (Lithuanian)

Currently translated at 100.0% (32 of 32 strings)

Translation: Auxio/Metadata
Translate-URL: https://hosted.weblate.org/projects/auxio/metadata/lt/

* Translated using Weblate (Belarusian)

Currently translated at 100.0% (279 of 279 strings)

Translation: Auxio/Strings
Translate-URL: https://hosted.weblate.org/projects/auxio/strings/be/

* Translated using Weblate (Serbian)

Currently translated at 8.9% (25 of 279 strings)

Translation: Auxio/Strings
Translate-URL: https://hosted.weblate.org/projects/auxio/strings/sr/

* Update translation files

Updated by "Cleanup translation files" hook in Weblate.

Translation: Auxio/Strings
Translate-URL: https://hosted.weblate.org/projects/auxio/strings/

* Translated using Weblate (Hungarian)

Currently translated at 94.6% (263 of 278 strings)

Translation: Auxio/Strings
Translate-URL: https://hosted.weblate.org/projects/auxio/strings/hu/

* Translated using Weblate (Hungarian)

Currently translated at 100.0% (278 of 278 strings)

Translation: Auxio/Strings
Translate-URL: https://hosted.weblate.org/projects/auxio/strings/hu/

* Translated using Weblate (Hebrew)

Currently translated at 59.3% (165 of 278 strings)

Translation: Auxio/Strings
Translate-URL: https://hosted.weblate.org/projects/auxio/strings/he/

* Translated using Weblate (Hungarian)

Currently translated at 96.8% (31 of 32 strings)

Translation: Auxio/Metadata
Translate-URL: https://hosted.weblate.org/projects/auxio/metadata/hu/

* Translated using Weblate (Hungarian)

Currently translated at 100.0% (278 of 278 strings)

Translation: Auxio/Strings
Translate-URL: https://hosted.weblate.org/projects/auxio/strings/hu/

* Translated using Weblate (Hebrew)

Currently translated at 87.4% (243 of 278 strings)

Translation: Auxio/Strings
Translate-URL: https://hosted.weblate.org/projects/auxio/strings/he/

---------

Co-authored-by: Eric <hamburger2048@users.noreply.hosted.weblate.org>
Co-authored-by: Fjuro <ifjuro@proton.me>
Co-authored-by: gallegonovato <fran-carro@hotmail.es>
Co-authored-by: atilluF <110931720+atilluF@users.noreply.github.com>
Co-authored-by: BMT[UA] <weblate@yopmail.com>
Co-authored-by: qwerty287 <ndev@web.de>
Co-authored-by: Tibor Botfai (gidano) <gidano@gmail.com>
Co-authored-by: AHOHNMYC <lqwh2h2cwa@protonmail.com>
Co-authored-by: Макар Разин <makarrazin14@gmail.com>
Co-authored-by: Milo Ivir <mail@milotype.de>
Co-authored-by: Vaclovas Intas <vaclovas1999@gmail.com>
Co-authored-by: Yosef Or Boczko <yoseforb@gnome.org>
2023-05-28 16:04:17 +00:00
Alexander Capehart
61c71d4419
image: fix memory leaks
Fix memory leaks stemming from failing to close unused InputStreams
after mosiac creation or if mosaics could not be created outright.
2023-05-28 10:01:10 -06:00
Alexander Capehart
d539c35518
ui: fix button log spam
Fix log spam about unresolved attrs coming from button apparently
forgetting where it's default icon tint is.
2023-05-28 09:06:41 -06:00
Alexander Capehart
6fc743990d
actions: disable tests for now
I need to do them right before enabling this.
2023-05-26 16:39:53 -06:00
Alexander Capehart
699227c1a8
all: relog project
Fill in a lot of code paths in the project with log statements in order
to improve the debugging experience.
2023-05-26 16:36:06 -06:00
Alexander Capehart
b037cfb166
music: improve sorting
Update sorting usage in-app so that it's only done when absolutely
necessary.
2023-05-25 13:47:11 -06:00
Alexander Capehart
c2def19aee
ui: handle playing indicator edge cases
Handle two edge cases identified with the playing indicator behavior:
1. When enqueing songs from another parent, the prior parent is still
indicates as "playing" when it kind-of isn't.
2. When playback is stopped, the parent is not reset, and thus will
still be indicated as "playing" after the song has disappeared. This
is rarer and should be resolved in other ways, but the solution to
1 also fixes this.

Resolves #380.
2023-05-25 13:16:58 -06:00
Alexander Capehart
21a6b97bfa
build: update deps
AGP -> 8.0.2
Coil -> 2.4.0
2023-05-25 12:59:45 -06:00
Alexander Capehart
ba94d4fa21
detail: group implicit albums in "appears on"
Group albums implicitly linked to an artist via the "artist" tag into
their own section called "Appears on".

This makes Auxio's artist model a bit more apparent to users.

Resolves #411.
2023-05-25 12:54:23 -06:00
Alexander Capehart
8939d341e6
detail: default to "no disc" instead of "disc 1"
Default tracks without a disc to a group called "No disc" instead of
disc 1.

This should reduce confusion on the user end, as it will make improper
taggings more apparent instead of simply degrading to a werid sort
ordering.

Resolves #405.
2023-05-25 12:03:37 -06:00
Alexander Capehart
4210a8d247
ui: disable some options w/empty parents
Disable most playback and playlisting operations when an artist or
playlist is empty.
2023-05-25 11:55:49 -06:00