[PR #1004] [CLOSED] Improves cover handling by adding file name hashing. #1514

Closed
opened 2026-02-26 03:31:18 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/koel/koel/pull/1004
Author: @patric-eberle
Created: 6/22/2019
Status: Closed

Base: masterHead: feature/hashed-filename-for-covers


📝 Commits (1)

  • aca53bf Fixes missing cover when toggling compilation state of a song.

📊 Changes

1 file changed (+37 additions, -2 deletions)

View changed files

📝 app/Models/Album.php (+37 -2)

📄 Description

When fixing the missing covers when toggling the compilation state of songs (#1003) I discovered, that a big pile of cover files where created during this process, because random file names are created. So even while the cover was always the same image, I had dozens of them in the end.

I decided to change the file name creation from random string to content based hash. Now covers can be reused. The downside is, that this method is a bit slower.

I choose sha256 because it seems to have the best speed/non conflict hash ratio.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/koel/koel/pull/1004 **Author:** [@patric-eberle](https://github.com/patric-eberle) **Created:** 6/22/2019 **Status:** ❌ Closed **Base:** `master` ← **Head:** `feature/hashed-filename-for-covers` --- ### 📝 Commits (1) - [`aca53bf`](https://github.com/koel/koel/commit/aca53bfebbe200d1ff292d3413082a0e193431bd) Fixes missing cover when toggling compilation state of a song. ### 📊 Changes **1 file changed** (+37 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `app/Models/Album.php` (+37 -2) </details> ### 📄 Description When fixing the missing covers when toggling the compilation state of songs (#1003) I discovered, that a big pile of cover files where created during this process, because random file names are created. So even while the cover was always the same image, I had dozens of them in the end. I decided to change the file name creation from random string to content based hash. Now covers can be reused. The downside is, that this method is a bit slower. I choose sha256 because it seems to have the best speed/non conflict hash ratio. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-26 03:31:18 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/koel-koel#1514
No description provided.