Skip to content

Commit

Permalink
Remove unused functions. Update formatting.
Browse files Browse the repository at this point in the history
  • Loading branch information
WeedLordVegeta420 committed Dec 19, 2024
1 parent 8e2f39f commit a487b27
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 62 deletions.
59 changes: 0 additions & 59 deletions pkg/scraper/stash.go
Original file line number Diff line number Diff line change
Expand Up @@ -396,65 +396,6 @@ func (s *stashScraper) scrapeByURL(_ context.Context, _ string, _ ScrapeContentT
return nil, ErrNotSupported
}

func sceneToUpdateInput(scene *models.Scene) models.SceneUpdateInput {
dateToStringPtr := func(s *models.Date) *string {
if s != nil {
v := s.String()
return &v
}

return nil
}

// fallback to file basename if title is empty
title := scene.GetTitle()

var url *string
urls := scene.URLs.List()
if len(urls) > 0 {
url = &urls[0]
}

return models.SceneUpdateInput{
ID: strconv.Itoa(scene.ID),
Title: &title,
Details: &scene.Details,
// include deprecated URL for now
URL: url,
Urls: urls,
Date: dateToStringPtr(scene.Date),
}
}

func galleryToUpdateInput(gallery *models.Gallery) models.GalleryUpdateInput {
dateToStringPtr := func(s *models.Date) *string {
if s != nil {
v := s.String()
return &v
}

return nil
}

// fallback to file basename if title is empty
title := gallery.GetTitle()

var url *string
urls := gallery.URLs.List()
if len(urls) > 0 {
url = &urls[0]
}

return models.GalleryUpdateInput{
ID: strconv.Itoa(gallery.ID),
Title: &title,
Details: &gallery.Details,
URL: url,
Urls: urls,
Date: dateToStringPtr(gallery.Date),
}
}

func imageToUpdateInput(gallery *models.Image) models.ImageUpdateInput {
dateToStringPtr := func(s *models.Date) *string {
if s != nil {
Expand Down
6 changes: 4 additions & 2 deletions ui/v2.5/src/components/Images/ImageDetails/ImageEditPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export const ImageEditPanel: React.FC<IProps> = ({
});

const { tags, updateTagsStateFromScraper, tagsControl } = useTagsEdit(
image.tags,
image.tags,
(ids) => formik.setFieldValue("tag_ids", ids)
);

Expand Down Expand Up @@ -417,7 +417,9 @@ export const ImageEditPanel: React.FC<IProps> = ({
<Button
className="edit-button"
variant="primary"
disabled={(!isNew && !formik.dirty) || !isEqual(formik.errors, {})}
disabled={
(!isNew && !formik.dirty) || !isEqual(formik.errors, {})
}
onClick={() => formik.submitForm()}
>
<FormattedMessage id="actions.save" />
Expand Down
8 changes: 7 additions & 1 deletion ui/v2.5/src/components/Settings/SettingsScrapingPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,13 @@ const ScrapersSection: React.FC = () => {
}
}

if (loadingScenes || loadingGalleries || loadingPerformers || loadingGroups || loadingImages)
if (
loadingScenes ||
loadingGalleries ||
loadingPerformers ||
loadingGroups ||
loadingImages
)
return (
<SettingSection headingID="config.scraping.scrapers">
<LoadingIndicator />
Expand Down

0 comments on commit a487b27

Please sign in to comment.