mirror of
https://github.com/fergalmoran/picard.git
synced 2026-02-28 10:33:59 +00:00
Remove erronous unsupported file formats from tagger
This commit is contained in:
@@ -108,6 +108,12 @@ class File(QtCore.QObject, Item):
|
||||
if error is not None:
|
||||
self.error = str(error)
|
||||
self.state = self.ERROR
|
||||
from picard.formats import supported_extensions
|
||||
file_name, file_extension = os.path.splitext(self.base_filename)
|
||||
if file_extension not in supported_extensions():
|
||||
self.remove()
|
||||
log.error('Unsupported media file {} wrongly loaded. Removing ...'.format(self))
|
||||
return
|
||||
else:
|
||||
self.error = None
|
||||
self.state = self.NORMAL
|
||||
|
||||
@@ -118,14 +118,6 @@ class MP4File(File):
|
||||
file.add_tags()
|
||||
|
||||
metadata = Metadata()
|
||||
if not tags:
|
||||
# MPEG-4 file in an mov container is unsupported and is one of
|
||||
# the formats which returns a positive score in guess_format method
|
||||
# If we are unable to add tags, it is not a supported mp4 file
|
||||
# remove it and log an error
|
||||
log.error("Unable to load tags for file {}".format(self))
|
||||
self.remove()
|
||||
return metadata
|
||||
|
||||
for name, values in tags.items():
|
||||
if name in self.__text_tags:
|
||||
|
||||
Reference in New Issue
Block a user