feat: support load m3u8 playlist

This change is sponsored by @superuser7777

Related: https://github.com/BLumia/pineapple-pictures/issues/153
This commit is contained in:
2025-06-28 09:27:30 +08:00
parent c828f86b74
commit 2846e4907b
3 changed files with 31 additions and 1 deletions

View File

@ -175,7 +175,16 @@ MainWindow::~MainWindow()
void MainWindow::showUrls(const QList<QUrl> &urls)
{
if (!urls.isEmpty()) {
m_graphicsView->showFileFromPath(urls.first().toLocalFile());
const QUrl & firstUrl = urls.first();
if (urls.count() == 1) {
const QString lowerCaseUrlPath(firstUrl.path().toLower());
if (lowerCaseUrlPath.endsWith(".m3u8") || lowerCaseUrlPath.endsWith(".m3u")) {
m_pm->loadM3U8Playlist(firstUrl);
galleryCurrent(true, true);
return;
}
}
m_graphicsView->showFileFromPath(firstUrl.toLocalFile());
m_pm->loadPlaylist(urls);
} else {
m_graphicsView->showText(tr("File url list is empty"));