Skip to content

Delete old, unused assets #860

Description

@mscreations

When filing a bug, please include the following headings if possible. Any example text in this template can be deleted.

Overview of the Issue

Client had an issue uploading a video to their screenly device due to unicode in the metadata (See #859 for the fix). Although the asset never finished being added (as it errors out in the middle), the file is still stored in ~/screenly_assets. It just becomes orphaned since the database no longer refers to it. Since the video file is around 38MB and the client tried at least 6 times, it's using up some storage with no client visible way to fix the wasted space.

Reproduction Steps

  • Try to add a video with unicode in metadata (prior to fix Fix issue with unicode metadata on uploaded video. #859). When the scripts try to get the video duration, they will fail due to the unicode issue. The asset will not be added, but the file is still stored in ~/screenly_assets.

Environment

  • Raspberry Pi Hardware Version: Zero W
  • Screenly OSE Version: e5f83ee roughly. The client has some very specific modifications that were applied on top of that particular commit. None of the modifications affects this issue. It still occurs with the vanilla commit. The modifications just add an internal clock display with customization for the client.

Suggestion

I'd suggest a startup script that could check the database and any stored assets that are not referenced from the database would get deleted. A possibility would be to make it so you could trigger the script from settings.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions