mirror of
https://github.com/stashapp/stash.git
synced 2025-12-16 20:07:05 +03:00
Fix bulk tagger again (#4133)
* Add ForEndpoint method * Fix typo in schema 48 migration
This commit is contained in:
@@ -208,6 +208,19 @@ func (r RelatedStashIDs) List() []StashID {
|
||||
return r.list
|
||||
}
|
||||
|
||||
// ForID returns the StashID object for the given endpoint. Returns nil if not found.
|
||||
func (r *RelatedStashIDs) ForEndpoint(endpoint string) *StashID {
|
||||
r.mustLoaded()
|
||||
|
||||
for _, v := range r.list {
|
||||
if v.Endpoint == endpoint {
|
||||
return &v
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (r *RelatedStashIDs) load(fn func() ([]StashID, error)) error {
|
||||
if r.Loaded() {
|
||||
return nil
|
||||
|
||||
@@ -130,7 +130,7 @@ func (m *schema48PreMigrator) fixStudioNames(ctx context.Context) error {
|
||||
}
|
||||
}
|
||||
|
||||
logger.Info("Renaming duplicate studio id %d to %s", id, newName)
|
||||
logger.Infof("Renaming duplicate studio id %d to %s", id, newName)
|
||||
_, err := m.db.Exec("UPDATE studios SET name = ? WHERE id = ?", newName, id)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user