Keep contact sheets out of thumbnails folders
This commit is contained in:
parent
852e2cd5c1
commit
25f1f574ef
|
|
@ -419,11 +419,8 @@ func buildThumbView(state *appState) fyne.CanvasObject {
|
||||||
videoDir := filepath.Dir(state.thumbFile.Path)
|
videoDir := filepath.Dir(state.thumbFile.Path)
|
||||||
videoBaseName := strings.TrimSuffix(filepath.Base(state.thumbFile.Path), filepath.Ext(state.thumbFile.Path))
|
videoBaseName := strings.TrimSuffix(filepath.Base(state.thumbFile.Path), filepath.Ext(state.thumbFile.Path))
|
||||||
outputDir := filepath.Join(videoDir, fmt.Sprintf("%s_thumbnails", videoBaseName))
|
outputDir := filepath.Join(videoDir, fmt.Sprintf("%s_thumbnails", videoBaseName))
|
||||||
|
if state.thumbContactSheet {
|
||||||
// Check if output exists
|
outputDir = videoDir
|
||||||
if _, err := os.Stat(outputDir); os.IsNotExist(err) {
|
|
||||||
dialog.ShowInformation("No Results", "No generated thumbnails found. Generate thumbnails first.", state.window)
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// If contact sheet mode, try to open contact sheet image
|
// If contact sheet mode, try to open contact sheet image
|
||||||
|
|
@ -435,6 +432,22 @@ func buildThumbView(state *appState) fyne.CanvasObject {
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
legacyDir := filepath.Join(videoDir, fmt.Sprintf("%s_thumbnails", videoBaseName))
|
||||||
|
legacyPath := filepath.Join(legacyDir, fmt.Sprintf("%s_contact_sheet.jpg", videoBaseName))
|
||||||
|
if _, err := os.Stat(legacyPath); err == nil {
|
||||||
|
if err := openFile(legacyPath); err != nil {
|
||||||
|
dialog.ShowError(fmt.Errorf("failed to open contact sheet: %w", err), state.window)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
dialog.ShowInformation("No Results", "No generated contact sheet found. Generate one first.", state.window)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check if output exists
|
||||||
|
if _, err := os.Stat(outputDir); os.IsNotExist(err) {
|
||||||
|
dialog.ShowInformation("No Results", "No generated thumbnails found. Generate thumbnails first.", state.window)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// Otherwise, open first thumbnail
|
// Otherwise, open first thumbnail
|
||||||
|
|
@ -587,6 +600,11 @@ func (s *appState) createThumbJobForPath(path string) *queue.Job {
|
||||||
videoDir := filepath.Dir(path)
|
videoDir := filepath.Dir(path)
|
||||||
videoBaseName := strings.TrimSuffix(filepath.Base(path), filepath.Ext(path))
|
videoBaseName := strings.TrimSuffix(filepath.Base(path), filepath.Ext(path))
|
||||||
outputDir := filepath.Join(videoDir, fmt.Sprintf("%s_thumbnails", videoBaseName))
|
outputDir := filepath.Join(videoDir, fmt.Sprintf("%s_thumbnails", videoBaseName))
|
||||||
|
outputFile := outputDir
|
||||||
|
if s.thumbContactSheet {
|
||||||
|
outputDir = videoDir
|
||||||
|
outputFile = filepath.Join(videoDir, fmt.Sprintf("%s_contact_sheet.jpg", videoBaseName))
|
||||||
|
}
|
||||||
|
|
||||||
var count, width int
|
var count, width int
|
||||||
var description string
|
var description string
|
||||||
|
|
@ -605,7 +623,7 @@ func (s *appState) createThumbJobForPath(path string) *queue.Job {
|
||||||
Title: "Thumbnails: " + filepath.Base(path),
|
Title: "Thumbnails: " + filepath.Base(path),
|
||||||
Description: description,
|
Description: description,
|
||||||
InputFile: path,
|
InputFile: path,
|
||||||
OutputFile: outputDir,
|
OutputFile: outputFile,
|
||||||
Config: map[string]interface{}{
|
Config: map[string]interface{}{
|
||||||
"inputPath": path,
|
"inputPath": path,
|
||||||
"outputDir": outputDir,
|
"outputDir": outputDir,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user