Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
weblate committed Oct 20, 2022
2 parents e7a677a + 33de28c commit 9c66ce6
Show file tree
Hide file tree
Showing 10 changed files with 50 additions and 20 deletions.
2 changes: 1 addition & 1 deletion internal/manager/import.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func performImport(ctx context.Context, i importer, duplicateBehaviour ImportDup
if duplicateBehaviour == ImportDuplicateEnumFail {
return fmt.Errorf("existing object with name '%s'", name)
} else if duplicateBehaviour == ImportDuplicateEnumIgnore {
logger.Info("Skipping existing object")
logger.Infof("Skipping existing object %q", name)
return nil
}

Expand Down
5 changes: 4 additions & 1 deletion internal/manager/task_export.go
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,10 @@ func (t *ExportTask) zipWalkFunc(outDir string, z *zip.Writer) filepath.WalkFunc
func (t *ExportTask) zipFile(fn, outDir string, z *zip.Writer) error {
bn := filepath.Base(fn)

f, err := z.Create(filepath.Join(outDir, bn))
p := filepath.Join(outDir, bn)
p = filepath.ToSlash(p)

f, err := z.Create(p)
if err != nil {
return fmt.Errorf("error creating zip entry for %s: %s", fn, err.Error())
}
Expand Down
2 changes: 1 addition & 1 deletion internal/manager/task_import.go
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ func (t *ImportTask) ImportTag(ctx context.Context, tagJSON *jsonschema.Tag, pen
if err := t.ImportTag(ctx, childTagJSON, pendingParent, fail, readerWriter); err != nil {
var parentError tag.ParentTagNotExistError
if errors.As(err, &parentError) {
pendingParent[parentError.MissingParent()] = append(pendingParent[parentError.MissingParent()], tagJSON)
pendingParent[parentError.MissingParent()] = append(pendingParent[parentError.MissingParent()], childTagJSON)
continue
}

Expand Down
1 change: 1 addition & 0 deletions pkg/file/video/scan.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,5 +75,6 @@ func (d *Decorator) IsMissingMetadata(ctx context.Context, fs file.FS, f file.Fi
return vf.VideoCodec == unsetString || vf.AudioCodec == unsetString ||
vf.Format == unsetString || vf.Width == unsetNumber ||
vf.Height == unsetNumber || vf.FrameRate == unsetNumber ||
vf.Duration == unsetNumber ||
vf.BitRate == unsetNumber || interactive != vf.Interactive
}
2 changes: 1 addition & 1 deletion pkg/sqlite/migrations/32_files.up.sql
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ INSERT INTO `video_files`
)
SELECT
`files`.`id`,
`scenes`.`duration`,
COALESCE(`scenes`.`duration`, -1),
-- special values for unset to be updated during scan
COALESCE(`scenes`.`video_codec`, 'unset'),
COALESCE(`scenes`.`format`, 'unset'),
Expand Down
4 changes: 4 additions & 0 deletions pkg/sqlite/migrations/32_postmigrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,10 @@ func (m *schema32Migrator) migrateFiles(ctx context.Context) error {
if err != nil {
return fmt.Errorf("migrating file %s: %w", p, err)
}
} else {
// if we don't reassign from the placeholder, it will fail
// so log a warning at least here
logger.Warnf("Unable to migrate invalid path: %s", p)
}

lastID = id
Expand Down
48 changes: 32 additions & 16 deletions pkg/sqlite/migrations/35_assoc_tables.up.sql
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ INSERT INTO `performers_image_new`
SELECT
`performer_id`,
`image`
FROM `performers_image`;
FROM `performers_image` WHERE
`performer_id` IS NOT NULL;

DROP TABLE `performers_image`;
ALTER TABLE `performers_image_new` rename to `performers_image`;
Expand All @@ -38,7 +39,8 @@ INSERT INTO `studios_image_new`
SELECT
`studio_id`,
`image`
FROM `studios_image`;
FROM `studios_image` WHERE
`studio_id` IS NOT NULL;

DROP TABLE `studios_image`;
ALTER TABLE `studios_image_new` rename to `studios_image`;
Expand All @@ -64,7 +66,8 @@ INSERT INTO `movies_images_new`
`movie_id`,
`front_image`,
`back_image`
FROM `movies_images`;
FROM `movies_images` WHERE
`movie_id` IS NOT NULL;

DROP TABLE `movies_images`;
ALTER TABLE `movies_images_new` rename to `movies_images`;
Expand All @@ -87,7 +90,8 @@ INSERT INTO `tags_image_new`
SELECT
`tag_id`,
`image`
FROM `tags_image`;
FROM `tags_image` WHERE
`tag_id` IS NOT NULL;

DROP TABLE `tags_image`;
ALTER TABLE `tags_image_new` rename to `tags_image`;
Expand All @@ -112,7 +116,8 @@ INSERT INTO `performers_scenes_new`
SELECT
`performer_id`,
`scene_id`
FROM `performers_scenes` WHERE true
FROM `performers_scenes` WHERE
`performer_id` IS NOT NULL AND `scene_id` IS NOT NULL
ON CONFLICT (`scene_id`, `performer_id`) DO NOTHING;

DROP TABLE `performers_scenes`;
Expand Down Expand Up @@ -140,7 +145,8 @@ INSERT INTO `scene_markers_tags_new`
SELECT
`scene_marker_id`,
`tag_id`
FROM `scene_markers_tags` WHERE true
FROM `scene_markers_tags` WHERE
`scene_marker_id` IS NOT NULL AND `tag_id` IS NOT NULL
ON CONFLICT (`scene_marker_id`, `tag_id`) DO NOTHING;

DROP TABLE `scene_markers_tags`;
Expand Down Expand Up @@ -168,7 +174,8 @@ INSERT INTO `scenes_tags_new`
SELECT
`scene_id`,
`tag_id`
FROM `scenes_tags` WHERE true
FROM `scenes_tags` WHERE
`scene_id` IS NOT NULL AND `tag_id` IS NOT NULL
ON CONFLICT (`scene_id`, `tag_id`) DO NOTHING;

DROP TABLE `scenes_tags`;
Expand Down Expand Up @@ -199,7 +206,8 @@ INSERT INTO `movies_scenes_new`
`movie_id`,
`scene_id`,
`scene_index`
FROM `movies_scenes` WHERE true
FROM `movies_scenes` WHERE
`movie_id` IS NOT NULL AND `scene_id` IS NOT NULL
ON CONFLICT (`movie_id`, `scene_id`) DO NOTHING;

DROP TABLE `movies_scenes`;
Expand All @@ -225,7 +233,8 @@ INSERT INTO `scenes_cover_new`
SELECT
`scene_id`,
`cover`
FROM `scenes_cover`;
FROM `scenes_cover` WHERE
`scene_id` IS NOT NULL;

DROP TABLE `scenes_cover`;
ALTER TABLE `scenes_cover_new` rename to `scenes_cover`;
Expand All @@ -250,7 +259,8 @@ INSERT INTO `performers_images_new`
SELECT
`performer_id`,
`image_id`
FROM `performers_images` WHERE true
FROM `performers_images` WHERE
`performer_id` IS NOT NULL AND `image_id` IS NOT NULL
ON CONFLICT (`image_id`, `performer_id`) DO NOTHING;

DROP TABLE `performers_images`;
Expand Down Expand Up @@ -278,7 +288,8 @@ INSERT INTO `images_tags_new`
SELECT
`image_id`,
`tag_id`
FROM `images_tags` WHERE true
FROM `images_tags` WHERE
`image_id` IS NOT NULL AND `tag_id` IS NOT NULL
ON CONFLICT (`image_id`, `tag_id`) DO NOTHING;

DROP TABLE `images_tags`;
Expand Down Expand Up @@ -308,7 +319,8 @@ INSERT INTO `scene_stash_ids_new`
`scene_id`,
`endpoint`,
`stash_id`
FROM `scene_stash_ids`;
FROM `scene_stash_ids` WHERE
`scene_id` IS NOT NULL AND `endpoint` IS NOT NULL AND `stash_id` IS NOT NULL;

DROP TABLE `scene_stash_ids`;
ALTER TABLE `scene_stash_ids_new` rename to `scene_stash_ids`;
Expand All @@ -333,7 +345,8 @@ INSERT INTO `scenes_galleries_new`
SELECT
`scene_id`,
`gallery_id`
FROM `scenes_galleries` WHERE true
FROM `scenes_galleries` WHERE
`scene_id` IS NOT NULL AND `gallery_id` IS NOT NULL
ON CONFLICT (`scene_id`, `gallery_id`) DO NOTHING;

DROP TABLE `scenes_galleries`;
Expand Down Expand Up @@ -361,7 +374,8 @@ INSERT INTO `galleries_images_new`
SELECT
`gallery_id`,
`image_id`
FROM `galleries_images` WHERE true
FROM `galleries_images` WHERE
`image_id` IS NOT NULL AND `gallery_id` IS NOT NULL
ON CONFLICT (`gallery_id`, `image_id`) DO NOTHING;

DROP TABLE `galleries_images`;
Expand Down Expand Up @@ -389,7 +403,8 @@ INSERT INTO `performers_galleries_new`
SELECT
`performer_id`,
`gallery_id`
FROM `performers_galleries` WHERE true
FROM `performers_galleries` WHERE
`performer_id` IS NOT NULL AND `gallery_id` IS NOT NULL
ON CONFLICT (`gallery_id`, `performer_id`) DO NOTHING;

DROP TABLE `performers_galleries`;
Expand Down Expand Up @@ -417,7 +432,8 @@ INSERT INTO `galleries_tags_new`
SELECT
`gallery_id`,
`tag_id`
FROM `galleries_tags` WHERE true
FROM `galleries_tags` WHERE
`tag_id` IS NOT NULL AND `gallery_id` IS NOT NULL
ON CONFLICT (`gallery_id`, `tag_id`) DO NOTHING;

DROP TABLE `galleries_tags`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ export const SettingsInterfacePanel: React.FC = () => {
<option value="ru-RU">Русский (Россия) (Preview)</option>
<option value="sv-SE">Svenska</option>
<option value="tr-TR">Türkçe (Türkiye)</option>
<option value="uk-UA">Ukrainian</option>
<option value="zh-TW">繁體中文 (台灣)</option>
<option value="zh-CN">简体中文 (中国)</option>
</SelectSetting>
Expand Down
4 changes: 4 additions & 0 deletions ui/v2.5/src/docs/en/Changelog/v0170.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ After migrating, please run a scan on your entire library to populate missing da
* Added release notes dialog. ([#2726](https://github.com/stashapp/stash/pull/2726))

### 🎨 Improvements
* **[0.17.1]** Added Ukrainian language option.
* Object titles are now displayed as the file basename if the title is not explicitly set. The `Don't include file extension as part of the title` scan flag is no longer supported.
* Optionally show Tag card when hovering over tag badge. ([#2708](https://github.com/stashapp/stash/pull/2708))
* Show default thumbnails for scenes and images where the actual image is not found. ([#2949](https://github.com/stashapp/stash/pull/2949))
Expand All @@ -27,6 +28,9 @@ After migrating, please run a scan on your entire library to populate missing da
* Moved Changelogs to Settings page. ([#2726](https://github.com/stashapp/stash/pull/2726))

### 🐛 Bug fixes
* **[0.17.1]** Fix Windows exporting incompatible zip files. ([#3022](https://github.com/stashapp/stash/pull/3022))
* **[0.17.1]** Fix migration error handling various NULL values. ([#3021](https://github.com/stashapp/stash/pull/3021))
* **[0.17.1]** Updated translations missed during release.
* Fix live transcoded videos hanging at end. ([#2996](https://github.com/stashapp/stash/pull/2996))
* Fix display of scene markers when title is empty. ([#2994](https://github.com/stashapp/stash/pull/2994))
* Fix tag marker count sorting. ([#2993](https://github.com/stashapp/stash/pull/2993))
Expand Down
1 change: 1 addition & 0 deletions ui/v2.5/src/locales/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export const localeLoader = {
plPL: () => import("./pl-PL.json"),
daDK: () => import("./da-DK.json"),
koKR: () => import("./ko-KR.json"),
ukUA: () => import("./uk-UA.json"),
// eslint-disable-next-line @typescript-eslint/no-explicit-any
} as { [key: string]: any };

Expand Down

0 comments on commit 9c66ce6

Please sign in to comment.