Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 30, 2025

When songs are deleted externally, Dimmer doesn't detect the change and continues showing them as playable, leading to playback failures.

Changes

File Verification Service

  • LibraryScannerService: Added VerifyExistingSongsAsync() that batch-processes songs (100 at a time) to check file existence and updates IsFileExists flag
  • AppInitializerService: Triggers verification on startup in background thread
  • MusicDataService: Added RemoveUnavailableSongsAsync() with cascading cleanup of orphaned albums, artists, and playlists

UI Indicators

Android (SongAdapter)

if (!song.IsFileExists)
{
    _title.Text = $"{UNAVAILABLE_PREFIX}{song.Title}";
    _img.Alpha = 0.5f;
    _container.Alpha = 0.7f;
}

Windows (XAML)

<Grid Opacity="{Binding IsFileExists, Converter={StaticResource FileExistsToOpacityConverter}}">
    <FontIcon Glyph="&#xE7BA;" 
              Visibility="{Binding IsFileExists, Converter={StaticResource BoolToInverseVisibilityConverter}}" />

Playback Prevention

Both platforms check IsFileExists before playback and show warnings (Snackbar on Android, ContentDialog on Windows).

Settings Management

New "Library Health" section with:

  • Toggle for ShowUnavailableSongs visibility (persisted to AppStateModel)
  • Manual verification button
  • Batch cleanup with confirmation dialog
  • Real-time status feedback

Query Helpers

  • RealmQueryHelper.AvailableSongs(): Filters to existing files only
  • RealmQueryHelper.AllSongsFiltered(): Conditional filtering based on user preference

Implementation Notes

  • Leverages existing IsFileExists property on SongModel
  • Uses TaggingUtils.FileExists() for file verification
  • Batch processing prevents UI blocking during large library scans
  • Visual indicators use 50% opacity to distinguish unavailable items while keeping them readable
Original prompt

This section details on the original issue you should resolve

<issue_title>Broken Feature 📱: When deleting songs from disk through an external app, Dimmer doesn't seem to reflect by deleting them from UI. </issue_title>
<issue_description>Can you always reproduce it?

  • Yes

If You Can Reproduce
Please Write down the steps from app startup till crash:

  1. Open any android file manager you have
  2. Delete any song that was scanned in Dimmer
  3. Go back to dimmer and it will still be there. Reboot too and same result.

Expected behavior
The song(s) shouldn't be there or should be indicated as not available.

It will be smart to indicate them instead of deleting from UI🤔

Because I don't really like the aspect of deleting fully the song from data base, user might loose some records they valued.
I think it's good that if a song is deleted, dimmer can show the song and indicate it's not available (toggleable) and have a menu that lets you decide if you want to flush out the data of the deleted song too from DB.

Because if a song goes missing by accident or mistake, and you decide to add a new song or say you are moving from MP3 to flac formats, you might want to transfer those data from old song file to new one.

I think it's a good approach.

</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 5 commits December 30, 2025 11:52
Co-authored-by: YBTopaz8 <41630728+YBTopaz8@users.noreply.github.com>
Co-authored-by: YBTopaz8 <41630728+YBTopaz8@users.noreply.github.com>
Co-authored-by: YBTopaz8 <41630728+YBTopaz8@users.noreply.github.com>
Co-authored-by: YBTopaz8 <41630728+YBTopaz8@users.noreply.github.com>
Co-authored-by: YBTopaz8 <41630728+YBTopaz8@users.noreply.github.com>
@YBTopaz8 YBTopaz8 marked this pull request as ready for review December 30, 2025 12:05
Copilot AI changed the title [WIP] Fix broken song deletion reflection in UI Handle deleted song files with verification and visual indicators Dec 30, 2025
Copilot AI requested a review from YBTopaz8 December 30, 2025 12:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Broken Feature 📱: When deleting songs from disk through an external app, Dimmer doesn't seem to reflect by deleting them from UI.

2 participants