Commit graph

1440 commits

Author SHA1 Message Date
Alexander Capehart
07e9ca8ef6
ui: flatten nav graph
Flatten the navigation graph into a single "main" graph that links
home to both explore and preference fragments.

***This massively breaks the app in it's current state***. Further
changes and refactors are needed to get this back to working.
2023-06-27 17:30:11 -06:00
Alexander Capehart
f8a0a42dd3
music: finalize duplicate tags fix
Officially finalize the fix for #484, at least I think.

Resolves #484.
2023-06-26 17:56:48 -06:00
Alexander Capehart
6f6a3d8d31
music: handle duplicate artist/genre values
Remove functionally duplicate artist/genre values that were read from
a file.

This caused a indexer crash in 3.1.2 due to the switch to music sets,
which no longer made duplicate values group the song twice. This then
cascaded to a failure in song finalization, as it expects there to be
the same amount of artists/genres as raw artists/genres.
2023-06-25 16:49:44 -06:00
Alexander Capehart
5bda85fe36
all: minor cleanup 2023-06-24 17:45:36 -06:00
Alexander Capehart
2adb34dffe
music: prevent deadlock on no-op refreshes
Fix a regression where the loading process will never stop on a no-op
refresh operation.

This was an oversight made in the redocumentation of the loading
process.
2023-06-24 17:30:56 -06:00
Alexander Capehart
29162820ae
ui: update bottomsheetbehavior
Update BottomSheetBehavior to the latest commit in 1.10.0-alpha04.

This adds a few new APIs that I still can't really use. I could in the
future.
2023-06-24 17:30:06 -06:00
Alexander Capehart
992457f361
music: document indexing process
Further document the music indexing process.

It's so aggressively parallelized as to require some more extensive
comments to actually make it clear what's going on.
2023-06-24 10:34:31 -06:00
Alexander Capehart
ed7b4e1410
music: recognize spaced artist tags
Recognize artists sort, albumartists sort, and album artists tags.

These are written by mediafile, so they are probably also written by
other software.
2023-06-24 09:04:21 -06:00
Alexander Capehart
19e8536323
music: fix testing artifacts in loading process
Fix testing lines created when working on the prior commit.
2023-06-23 08:49:08 -06:00
Alexander Capehart
036d952085
music: avoid hanging on discovery errors
Do not hang when an error halts the discovery process.

This was an oversight with the previous band-aid fix regarding handling
errors in music loading. If something failed, the channels would not
close, resulting in the main loop consuming the channel hanging.

There's probably a deeper issue causing this in 3.1.2, but with this
fix I can actually start digging for it.
2023-06-23 08:43:21 -06:00
Alexander Capehart
903a3e561a
image: add option to restore 1:1 crop behavior
Add an option to restore the old 1:1 crop behavior to the app.

Some people think this looks better, some people like to have youtube
thumbnails in their APICs. Can't really be opinionated here.
2023-06-20 17:25:37 -06:00
Alexander Capehart
8c604dae68
Merge branch 'api34' into dev 2023-06-20 16:58:48 -06:00
Alexander Capehart
7b4af3515d
music: prioritize earlier album artist info
Prioritize artist information from earlier albums (date-wise), as it's
less likely to change with the addition of new music.
2023-06-15 19:11:31 -06:00
Alexander Capehart
321bbcf03f
all: fix api 34 crashes
Fix general API 34 crashes that I could notice immediately.

Can really test any further since the API 34 AVDs are currently potatos
running at 3 FPS for some reason.
2023-06-15 13:32:05 -06:00
Alexander Capehart
6b43a65e56
build: update to api 34
Update the app to target API 34, alongside all dependencies that expect
such.

This finally fixes some long-standing issues in newer version of MDC,
thus allowing me to remove the divider backport as well.

More work is required for predictive back (don't even know where I
start with that...), but this is a good start.
2023-06-15 13:06:17 -06:00
Alexander Capehart
839861b6b8
music: fix grouping regressions
Fix regressions in grouping, mostly around the kind of music that is
prioritized and sort naming.
2023-06-15 12:58:10 -06:00
Alexander Capehart
31d647123f
music: use set for child information
Use sets for all child music information.

Unlike parent information, which usually has an ordering derived from
file information, child music information more or less doesn't, and
will be consistently re-interpreted by the app to apply user-configured
sorts.
2023-06-13 10:44:53 -06:00
Alexander Capehart
d22de34fd3
music: use sets for library information
Use a Set when storing all song, album, artist, and genre information.

These all have no consistent ordering due to parallelization, and
should be communicated as such.
2023-06-13 10:03:48 -06:00
Alexander Capehart
5b44c31689
music: sort song information
Sort song informtion in all MusicParent instances.

This is a temporary hack to band-aid music consistency between reloads,
as with the aggressive parallelization song order is no longer
consistent.
2023-06-13 09:37:18 -06:00
Alexander Capehart
530e427b79
music: improve library updates
Update library information in a synchronized block and then only
dispatch the update on the main thread.
2023-06-13 08:58:08 -06:00
Alexander Capehart
0771a75b5a
playback: ignore zeroed replaygain tags
Ignore ReplayGain adjustments that are just 0 dB.
2023-06-13 08:57:03 -06:00
Alexander Capehart
4ee20bc112
playback: fix regression regarding partial rgadj
Fix a regression where partial ReplayGain adjustments missing an album
or track component would not be indexed.

This was an oversight made when moving adjustments to the cache, as the
nullability model of ReplayGain adjustments changed.
2023-06-09 10:08:44 -06:00
Alexander Capehart
672c256b1e
music: group albums by raw artist keys
Properly group albums by raw artist keys, instead of by raw artist
instances.

This was an accidental regression in 3.1.1 that resulted in duplicate
albums in some circumstances.

Resolves #475.
2023-06-08 20:40:09 -06:00
Alexander Capehart
e848bea0bf
music: remove zero digit-likes from names
Remove all characters with a semantic meaning of "zero" from the start
of music names, at least when intelligent sorting is enabled.
2023-06-08 14:09:09 -06:00
Alexander Capehart
93d3e82140
ui: use targetstate more
Use targetState whenever making decisions on whether a certain sheet
state change is valid.

This is mostly for stylistic consistency and has no effect on UX.
2023-06-08 13:49:24 -06:00
Alexander Capehart
abe4255986
list: actually update playlist selections
Remove an incorrect change check resulting in the selection not
updating when playlist information changed.

Resolves #476.
2023-06-08 13:37:12 -06:00
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
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
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
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