Skip to content

Codex/add podcast search and subscription feature#35

Merged
leftouterjoins merged 12 commits intodevelopmentfrom
codex/add-podcast-search-and-subscription-feature
Jun 19, 2025
Merged

Codex/add podcast search and subscription feature#35
leftouterjoins merged 12 commits intodevelopmentfrom
codex/add-podcast-search-and-subscription-feature

Conversation

@leftouterjoins
Copy link
Owner

No description provided.

@leftouterjoins leftouterjoins merged commit b5d928f into development Jun 19, 2025
3 checks passed
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: File Retrieval Fails for Database-Stored Files

The getFileById and getFileByUrlHash methods in State.php now incorrectly assume all files are stored on disk by removing the storage_mode check. For existing installations with database-stored files, the data column contains binary content, not a filename. This causes loadFile() to fail when attempting to read binary data as a path, making these files unretrievable and corrupting the filename field in the returned array. This is a breaking change without a migration path for existing database-stored media.

src/Brickner/Podsumer/State.php#L262-L298

{
$sql = 'SELECT files.id, url, url_hash, mimetype, filename, size, cached, file_contents.content_hash, file_contents.data FROM files JOIN file_contents ON files.content_hash = file_contents.content_hash WHERE files.id = :file_id';
$file = $this->query($sql, ['file_id' => $file_id])[0] ?? [];
if (!empty($file)) {
$filename = $file['data'];
try {
$file['data'] = $this->loadFile($filename);
} catch (Exception $e) {
}
$file['filename'] = $filename;
}
return $file;
}
public function getFileByUrlHash(string $url_hash): array
{
$sql = 'SELECT files.id, url, url_hash, mimetype, filename, size, cached, file_contents.content_hash, file_contents.data FROM files JOIN file_contents ON files.content_hash = file_contents.content_hash WHERE url_hash = :url_hash';
$file = $this->query($sql, ['url_hash' => $url_hash])[0] ?? [];
if (!empty($file)) {
$filename = $file['data'];
try {
$file['data'] = $this->loadFile($filename);
} catch (Exception $e) {
}
$file['filename'] = $filename;
}
return $file;
}

Fix in Cursor


BugBot free trial expires on July 22, 2025
You have used $0.00 of your $50.00 spend limit so far. Manage your spend limit in the Cursor dashboard.

Was this report helpful? Give feedback by reacting with 👍 or 👎

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.

1 participant