Improve detection of filename extension of audio/video files

This commit is contained in:
Chocobo1 2021-02-21 17:06:30 +08:00
parent 529dd6e3a8
commit e1f9083c81
No known key found for this signature in database
GPG key ID: 210D9C873253A68C
4 changed files with 21 additions and 8 deletions

View file

@ -44,6 +44,7 @@
#include <QVector>
#include <QWheelEvent>
#include "base/bittorrent/common.h"
#include "base/bittorrent/infohash.h"
#include "base/bittorrent/session.h"
#include "base/bittorrent/torrent.h"
@ -93,7 +94,10 @@ namespace
for (int i = 0; i < torrent->filesCount(); ++i)
{
if (Utils::Misc::isPreviewable(Utils::Fs::fileExtension(torrent->fileName(i))))
QString fileName = torrent->fileName(i);
if (fileName.endsWith(QB_EXT))
fileName.chop(QB_EXT.length());
if (Utils::Misc::isPreviewable(fileName))
return true;
}