Skip to content

Support m3u8 ending in playlist plugin #5829

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

JOJ0
Copy link
Member

@JOJ0 JOJ0 commented Jun 21, 2025

Description

m3u8 files are technically supported in the playlist plugin, only the difference in the file ending prevented usage of such files.

  • Documentation. (not required, the current wording implies support of m3u files in general, this should include m3u8 which only makes clear that they are UTF-8 encoded)
  • Changelog. (will do after review)
  • Tests. (not required)

Copy link

Thank you for the PR! The changelog has not been updated, so here is a friendly reminder to check if you need to add an entry.

@JOJ0 JOJ0 marked this pull request as ready for review June 21, 2025 09:26
@Copilot Copilot AI review requested due to automatic review settings June 21, 2025 09:26
Copy link

Thank you for the PR! The changelog has not been updated, so here is a friendly reminder to check if you need to add an entry.

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request updates the playlist plugin to support m3u8 files by replacing the hardcoded glob pattern with a new constant (M3U_GLOB) used in both playlist scanning and directory listing.

  • Introduces the M3U_GLOB constant to capture m3u8 file endings.
  • Refactors the file matching checks to use the new constant.

@@ -22,6 +22,8 @@
from beets.library import BLOB_TYPE
from beets.util import path_as_posix

M3U_GLOB = "*.[mM]3[uU]8?"
Copy link
Preview

Copilot AI Jun 21, 2025

Choose a reason for hiding this comment

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

The glob pattern defined in M3U_GLOB may not match plain '.m3u' files since '?' in fnmatch requires a character. Consider updating the logic to explicitly accept both '.m3u' and '.m3u8' extensions, for example by checking file extensions directly or using multiple patterns.

Suggested change
M3U_GLOB = "*.[mM]3[uU]8?"
M3U_GLOB = ('.m3u', '.m3u8')

Copilot uses AI. Check for mistakes.

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