mirror of
https://github.com/stashapp/stash.git
synced 2025-12-18 04:44:37 +03:00
Add Image Scraping (#5562)
Co-authored-by: keenbed <155155956+keenbed@users.noreply.github.com> Co-authored-by: WithoutPants <53250216+WithoutPants@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
b6ace42973
commit
e97f647a43
@@ -73,6 +73,24 @@ func queryURLParametersFromGallery(gallery *models.Gallery) queryURLParameters {
|
||||
return ret
|
||||
}
|
||||
|
||||
func queryURLParametersFromImage(image *models.Image) queryURLParameters {
|
||||
ret := make(queryURLParameters)
|
||||
ret["checksum"] = image.Checksum
|
||||
|
||||
if image.Path != "" {
|
||||
ret["filename"] = filepath.Base(image.Path)
|
||||
}
|
||||
if image.Title != "" {
|
||||
ret["title"] = image.Title
|
||||
}
|
||||
|
||||
if len(image.URLs.List()) > 0 {
|
||||
ret["url"] = image.URLs.List()[0]
|
||||
}
|
||||
|
||||
return ret
|
||||
}
|
||||
|
||||
func (p queryURLParameters) applyReplacements(r queryURLReplacements) {
|
||||
for k, v := range p {
|
||||
rpl, found := r[k]
|
||||
|
||||
Reference in New Issue
Block a user