Skip to content

Commit

Permalink
Fixed bug where thumbnail images were being generated for profiles th…
Browse files Browse the repository at this point in the history
…at don't support thumbnails. (#93)
  • Loading branch information
orchetect committed Apr 23, 2024
1 parent 6c4c660 commit 561b668
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Sources/MarkersExtractor/Export/ExportProfile Export.swift
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ extension ExportProfile {
// thumbnail images

let thumbnailsProgressUnitCount: Int64 = 90
if let media {
if Self.isMediaCapable, let media {
try await exportThumbnails(
markers: markers,
preparedMarkers: preparedMarkers,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ extension MIDIFileExportProfile {
)

buildMessages.forEach {
logger?.info("MIDI File: \($0)")
logger?.info("MIDI File diagnostic: \($0)")
}

let data = try midiFile.rawData()
Expand Down
13 changes: 10 additions & 3 deletions Sources/MarkersExtractor/MarkersExtractor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,16 @@ extension MarkersExtractor {
let exportMedia = try formExportMedia(projectName: projectName)
media = exportMedia
logger.info("Found project media file: \(exportMedia.videoURL.path.quoted).")
logger.info(
"Generating \(s.imageFormat.name) thumbnail images into \(outputURL.path.quoted)."
)

if s.exportFormat.concreteType.isMediaCapable {
logger.info(
"Generating \(s.imageFormat.name) thumbnail images into \(outputURL.path.quoted)."
)
} else {
logger.info(
"Export profile does not support thumbnail image generation. No thumbnails will be exported."
)
}
} catch {
// not a critical error - if no media is found, let extraction continue without media
media = nil
Expand Down

0 comments on commit 561b668

Please sign in to comment.