Fix even more deprecation warnings

This commit is contained in:
Damiano Galassi committed 2026-09-22 18:51:35 +02:00
1 parent 97b88a2adb
commit 192de27e8d
3 files changed
+32 -5

No files matched your search

+10 -1
View File
@@ -907,7 +907,16 @@ class MovieViewController: PropertyView, NSTableViewDataSource, ExpandedTableVie
if let url = artwork as? URL {
let value = try? url.resourceValues(forKeys: [URLResourceKey.typeIdentifierKey])
if let type = value?.typeIdentifier, UTTypeConformsTo(type as CFString, "public.jpeg" as CFString), let data = try? Data(contentsOf: url) {
var isJpeg = false
if #available(macOS 11, *) {
isJpeg = value?.contentType?.conforms(to: .jpeg) ?? false
} else {
if let type = value?.typeIdentifier, UTTypeConformsTo(type as CFString, "public.jpeg" as CFString) {
isJpeg = true
}
}
if isJpeg, let data = try? Data(contentsOf: url) {
return MP42Image(data: data, type: MP42_ART_JPEG)
} else if let image = NSImage(contentsOf: url) {
return MP42Image(image: image)