Use basename as title if empty when scraping by fragment (#3040)

* Fallback to file basename if title empty in scrape
* Populate dialog from basename if title empty
This commit is contained in:
WithoutPants
2022-10-24 14:36:22 +11:00
committed by GitHub
parent 091950615e
commit 47395ce13f
3 changed files with 11 additions and 4 deletions

View File

@@ -319,9 +319,12 @@ func sceneToUpdateInput(scene *models.Scene) models.SceneUpdateInput {
return nil
}
// fallback to file basename if title is empty
title := scene.GetTitle()
return models.SceneUpdateInput{
ID: strconv.Itoa(scene.ID),
Title: &scene.Title,
Title: &title,
Details: &scene.Details,
URL: &scene.URL,
Date: dateToStringPtr(scene.Date),
@@ -338,9 +341,12 @@ func galleryToUpdateInput(gallery *models.Gallery) models.GalleryUpdateInput {
return nil
}
// fallback to file basename if title is empty
title := gallery.GetTitle()
return models.GalleryUpdateInput{
ID: strconv.Itoa(gallery.ID),
Title: &gallery.Title,
Title: &title,
Details: &gallery.Details,
URL: &gallery.URL,
Date: dateToStringPtr(gallery.Date),