Trim database path in migrate page (#3140)

This commit is contained in:
WithoutPants
2022-11-17 12:26:20 +11:00
committed by GitHub
parent 2cce547986
commit c1f271fc52
2 changed files with 8 additions and 1 deletions

View File

@@ -16,6 +16,12 @@ export const Migrate: React.FC = () => {
const intl = useIntl(); const intl = useIntl();
// if database path includes path separators, then this is passed through
// to the migration path. Extract the base name of the database file.
const databasePath = systemStatus
? systemStatus?.systemStatus.databasePath?.split(/[\\/]/).pop()
: "";
// make suffix based on current time // make suffix based on current time
const now = new Date() const now = new Date()
.toISOString() .toISOString()
@@ -24,7 +30,7 @@ export const Migrate: React.FC = () => {
.replace(/:/g, "") .replace(/:/g, "")
.replace(/\..*/, ""); .replace(/\..*/, "");
const defaultBackupPath = systemStatus const defaultBackupPath = systemStatus
? `${systemStatus.systemStatus.databasePath}.${systemStatus.systemStatus.databaseSchema}.${now}` ? `${databasePath}.${systemStatus.systemStatus.databaseSchema}.${now}`
: ""; : "";
const discordLink = ( const discordLink = (

View File

@@ -16,6 +16,7 @@
* Changed Performer height to be numeric, and changed filtering accordingly. ([#3060](https://github.com/stashapp/stash/pull/3060)) * Changed Performer height to be numeric, and changed filtering accordingly. ([#3060](https://github.com/stashapp/stash/pull/3060))
### 🐛 Bug fixes ### 🐛 Bug fixes
* Fixed database backup in incorrect directory during migration when database location is an absolute path. ([#3140](https://github.com/stashapp/stash/pull/3140))
* Fixed gallery create post hook not being fired during gallery creation. ([#3134](https://github.com/stashapp/stash/pull/3134)) * Fixed gallery create post hook not being fired during gallery creation. ([#3134](https://github.com/stashapp/stash/pull/3134))
* Fixed autotag error when tagging a large amount of objects. ([#3106](https://github.com/stashapp/stash/pull/3106)) * Fixed autotag error when tagging a large amount of objects. ([#3106](https://github.com/stashapp/stash/pull/3106))
* Fixed Gallery title being incorrectly marked as mandatory for file- and folder-based galleries. ([#3110](https://github.com/stashapp/stash/pull/3110)) * Fixed Gallery title being incorrectly marked as mandatory for file- and folder-based galleries. ([#3110](https://github.com/stashapp/stash/pull/3110))