MissingCore / Music

A Nothing inspired local music player.
GNU Affero General Public License v3.0
216 stars 13 forks source link

refactor: Have audio indexing logic be its own feature #31

Closed cyanChill closed 3 months ago

cyanChill commented 3 months ago

Why

To prepare for some future features, it makes sense to move the indexing logic to it's own "feature" folder and maybe also refactor the code a bit.

How

During the refactoring, I've noticed that I've forgot to add a check when we made "year" a part of uniqueness when adding a new album (as some artists release multiple albums under the same name).

In addition, we noticed some places where we delete any unused artwork early (which is good in case we forget), however, those calls were before we called cleanUpArtwork(), so we can forgo that step and rely more on cleanUpArtwork().

Test Plan

We should get the same output as prior when we open the app for the first time as a new user. The cleanup logic should also work as expected (can be tested by deleting a track temporary on our device).

Checklist