From 7b20a44b291a5005c0830922aac753653f143cd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marius=20D=C3=B6rbandt?= Date: Fri, 12 Jan 2024 12:43:50 +0100 Subject: [PATCH] Fix nil encodings as a migration Fixes SquotSoundMapper instances having no encoding after c0da9209a22bad571ab9546cd311f3f1fe90855b. --- .../instance/doPostUpdateMigrationsIn..st | 3 +++ .../SquotSoundMapper.class/instance/fixNilEncoding.st | 9 +++++++++ .../SquotSoundMapper.class/methodProperties.json | 2 ++ 3 files changed, 14 insertions(+) create mode 100644 src/Squot.package/SquotSoundMapper.class/instance/doPostUpdateMigrationsIn..st create mode 100644 src/Squot.package/SquotSoundMapper.class/instance/fixNilEncoding.st diff --git a/src/Squot.package/SquotSoundMapper.class/instance/doPostUpdateMigrationsIn..st b/src/Squot.package/SquotSoundMapper.class/instance/doPostUpdateMigrationsIn..st new file mode 100644 index 000000000..47dc40517 --- /dev/null +++ b/src/Squot.package/SquotSoundMapper.class/instance/doPostUpdateMigrationsIn..st @@ -0,0 +1,3 @@ +migrations +doPostUpdateMigrationsIn: aWorkingCopy + self fixNilEncoding. \ No newline at end of file diff --git a/src/Squot.package/SquotSoundMapper.class/instance/fixNilEncoding.st b/src/Squot.package/SquotSoundMapper.class/instance/fixNilEncoding.st new file mode 100644 index 000000000..87bf384b8 --- /dev/null +++ b/src/Squot.package/SquotSoundMapper.class/instance/fixNilEncoding.st @@ -0,0 +1,9 @@ +migrations +fixNilEncoding + | extension | + self encoding ifNotNil: [^ self]. + extension := self path extension asLowercase. + self encoding: + (self class validEncodings + detect: [:each | each asLowercase = extension] + ifNone: [self class defaultEncoding]) \ No newline at end of file diff --git a/src/Squot.package/SquotSoundMapper.class/methodProperties.json b/src/Squot.package/SquotSoundMapper.class/methodProperties.json index b34ce5ecf..eed712f5a 100644 --- a/src/Squot.package/SquotSoundMapper.class/methodProperties.json +++ b/src/Squot.package/SquotSoundMapper.class/methodProperties.json @@ -8,6 +8,8 @@ "wavEncoding" : "mad 9/20/2023 17:58" }, "instance" : { "canReadVersionFrom:" : "mad 10/19/2023 12:56", + "doPostUpdateMigrationsIn:" : "mad 1/12/2024 12:34", + "fixNilEncoding" : "mad 1/12/2024 12:37", "isValidVersion:" : "mad 10/21/2023 21:33", "readVersionFrom:" : "mad 10/17/2023 12:22", "transformVersion:ifFail:" : "mad 10/17/2023 12:33",