Skip to content

Commit

Permalink
Exported default filename to local var
Browse files Browse the repository at this point in the history
  • Loading branch information
michalrentka committed Jul 29, 2024
1 parent 8e7c957 commit f2226e7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ struct NoteEditorActionHandler: ViewModelActionHandler, BackgroundDbProcessingAc

DDLogInfo("NoteEditorActionHandler: Import \(rawImages.count) images")

let imageFilename = "image"
let libraryId = viewModel.state.library.identifier
var images: [(String, Attachment)] = []

Expand All @@ -88,7 +89,7 @@ struct NoteEditorActionHandler: ViewModelActionHandler, BackgroundDbProcessingAc
else { continue }

let key = KeyGenerator.newKey
let file = Files.attachmentFile(in: libraryId, key: key, filename: "image", contentType: mimeType)
let file = Files.attachmentFile(in: libraryId, key: key, filename: imageFilename, contentType: mimeType)

do {
try self.fileStorage.write(image, to: file, options: .atomic)
Expand All @@ -98,8 +99,8 @@ struct NoteEditorActionHandler: ViewModelActionHandler, BackgroundDbProcessingAc
}

let attachment = Attachment(
type: .file(filename: "image", contentType: mimeType, location: .local, linkType: .embeddedImage, compressed: false),
title: "image",
type: .file(filename: imageFilename, contentType: mimeType, location: .local, linkType: .embeddedImage, compressed: false),
title: imageFilename,
key: key,
libraryId: libraryId
)
Expand Down
3 changes: 3 additions & 0 deletions ci_scripts/ci_post_clone.sh
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,6 @@ esac
# Update Info.plist files
echo "Setting version to $newVersionString"
sed -i "" -e "s/MARKETING_VERSION \= [^\;]*\;/MARKETING_VERSION = $newVersionString;/" ../Zotero.xcodeproj/project.pbxproj

# Install node
which node || HOMEBREW_NO_AUTO_UPDATE=1 HOMEBREW_NO_INSTALL_CLEANUP=1 brew install node
4 changes: 1 addition & 3 deletions ci_scripts/ci_pre_xcodebuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,4 @@ plist='<?xml version="1.0" encoding="UTF-8"?>
</dict>
</plist>'
echo "$plist" > licenses/licenses.plist
rm -rf pdf-keys

brew install node
rm -rf pdf-keys

0 comments on commit f2226e7

Please sign in to comment.