pbek / QOwnNotes

QOwnNotes is a plain-text file notepad and todo-list manager with Markdown support and Nextcloud / ownCloud integration.
https://www.qownnotes.org/
GNU General Public License v2.0
4.6k stars 409 forks source link

[Q] Import Evernote enex wrong attachment naming #2621

Closed Gedankenleser closed 1 year ago

Gedankenleser commented 1 year ago

General question

Is it possible to get the orignal sames of the attachments while importing them? () QOwnNotes is using a generic name (media-).

Relevant log output in the Log panel

Expand ``` ```

Information about the application, settings and environment

Expand QOwnNotes Debug Information =========================== ## General Info **Current Date**: `So Okt 9 17:42:18 2022` **Version**: `22.9.2` **Build date**: `Sep 27 2022` **Build number**: `984` **Platform**: `windows` **Operating System**: `Windows 10 Version 2009` **Build architecture**: `x86_64` **Current architecture**: `x86_64` **Release**: `GitHub Actions` **Qt Version (build)**: `5.15.2` **Qt Version (runtime)**: `5.15.2` **Portable mode**: `no` **Settings path / key**: `\HKEY_CURRENT_USER\Software\PBE\QOwnNotes` **Application database path**: `C:\Users\Private\AppData\Roaming\PBE\QOwnNotes\QOwnNotes.sqlite` **Application arguments**: `G:\Downlaods\QOwnNotes\QOwnNotes.exe` **Qt Debug**: `0` **Locale (system)**: `de_DE` **Locale (interface)**: *empty* **Primary screen resolution**: `1920x1080` **Icon theme**: `breeze-qownnotes` **Notes in current note folder**: `6` **Calendar items**: `0` **Enabled scripts**: `0` ## Server Info **serverUrl**: `private` **appIsValid**: `yes` **notesPathExists**: `yes` **serverVersion**: `24.0.5.1` **appVersion**: *empty* ## Spellchecking **Enabled**: `false` **Selected language**: *empty* **Language codes**: *empty* **Language names**: *empty* **Application dictionaries path**: `C:\Users\Private\AppData\Roaming\PBE\QOwnNotes\dicts` ## Note folders **currentNoteFolderId**: `1` ### Note folder `Standard` **id**: `1` **isCurrent**: `yes` **activeTagId**: `0` **localPath**: `C:\Users\private\Nextcloud\Notes` **remotePath**: `Notes` **cloudConnectionId**: `1` **isShowSubfolders**: `yes` **isUseGit**: `no` **allowDifferentNoteFileName**: `no` **activeNoteSubFolder name**: *empty* **database file**: `C:\Users\private\Nextcloud\Notes\notes.sqlite` ## Cloud connections ### Cloud connection `Standard` **id**: `1` **isCurrent**: `yes` **serverUrl**: private **username**: `Private` **accountId**: `Private` ## Enabled scripts ## Settings **ActiveNoteHistoryItem** (NoteHistoryItem): `` **Debug/fakeOldVersionNumber** (QString): `false` **Debug/fileLogging** (QString): `false` **Editor/CurrentSchemaKey** (QString): `EditorColorSchema-6033d61b-cb96-46d5-a3a8-20d5172017eb` **Editor/autoBracketClosing** (QString): `true` **Editor/autoBracketRemoval** (QString): `true` **Editor/disableCursorBlinking** (QString): `false` **Editor/editorWidthInDFMOnly** (QString): `true` **Editor/highlightCurrentLine** (QString): `true` **Editor/indentSize** (int): `4` **Editor/removeTrailingSpaces** (QString): `false` **Editor/showLineNumbers** (QString): `false` **Editor/useTabIndent** (QString): `false` **Editor/vimMode** (QString): `false` **EvernoteImport/AttachmentImportCheckBoxChecked** (QString): `true` **EvernoteImport/ImageImportCheckBoxChecked** (QString): `true` **EvernoteImport/MetaDataUnCheckedList** (QStringList): `, ` **EvernoteImportDialog/geometry** (QByteArray): `` **FileDialog/LastPath** (QString): `G:/Downlaods` **FileDialog/LastPath-Evernote Import** (QString): `G:/Downlaods` **IssueAssistantDialog/geometry** (QByteArray): `` **LastUpdateCheck** (QDateTime): `2022-10-09T17:38:04.940` **LogWidget/criticalLog** (QString): `true` **LogWidget/debugLog** (QString): `true` **LogWidget/fatalLog** (QString): `true` **LogWidget/infoLog** (QString): `true` **LogWidget/scriptingLog** (QString): `true` **LogWidget/statusLog** (QString): `true` **LogWidget/warningLog** (QString): `true` **MainWindow/geometry** (QByteArray): `` **MainWindow/mainToolBar.iconSize** (int): `24` **MainWindow/menuBarGeometry** (QByteArray): `` **MainWindow/noteTextEdit.code.font** (QString): `Courier New,9,-1,2,50,0,0,0,0,0` **MainWindow/noteTextEdit.font** (QString): `MS Shell Dlg 2,8.25,-1,5,50,0,0,0,0,0` **MainWindow/noteTextView.code.font** (QString): `Courier New,9,-1,2,50,0,0,0,0,0` **MainWindow/noteTextView.font** (QString): `MS Shell Dlg 2,8.25,-1,5,50,0,0,0,0,0` **MainWindow/noteTextView.ignoreCodeFontSize** (QString): `true` **MainWindow/noteTextView.refreshDebounceTime** (int): `600` **MainWindow/noteTextView.rtl** (QString): `false` **MainWindow/noteTextView.underline** (QString): `true` **MainWindow/noteTextView.useEditorStyles** (QString): `true` **MainWindow/noteTextView.useInternalExportStyling** (QString): `true` **MainWindow/showNotesFromAllNoteSubFolders** (QString): `false` **MessageBoxOverride/windows-dark-mode** (int): `65536` **NoteFolder-1/NoteTabNameList** (QStringList): `Kündigung MC Fit` **NoteFolder-1/NoteTabStickinessList** (QStringList): *empty* **NoteFolder-1/NoteTabSubFolderPathDataList** (QStringList): *empty* **NoteHistory-1** (QVariantList): `` **NoteHistoryCurrentIndex-1** (int): `6` **PiwikClientId** (QString): `` **ScriptRepositoryDialog/mainSplitterState** (QByteArray): `` **SearchEngineId** (int): `0` **SettingsDialog/geometry** (QByteArray): `` **SettingsDialog/mainSplitterState** (QByteArray): `` **ShowSystemTray** (QString): `false` **StartHidden** (QString): `false` **WelcomeDialog/geometry** (QByteArray): `` **acceptAllExternalModifications** (QString): `false` **allowNoteEditing** (QString): `true` **allowOnlyOneAppInstance** (QString): `true` **appMetrics/disableAppHeartbeat** (QString): `false` **appMetrics/disableTracking** (QString): `false` **appMetrics/notificationShown** (QString): `true` **automaticNoteFolderDatabaseClosing** (QString): `false` **checkSpelling** (QString): `false` **closeTodoListAfterSave** (QString): `false` **cryptoKey** (qlonglong): `` **currentNoteFolderId** (int): `1` **currentWorkspace** (QString): `initial` **cursorWidth** (int): `1` **darkMode** (QString): `false` **darkModeColors** (QString): `true` **darkModeIconTheme** (QString): `false` **darkModeTrayIcon** (QString): `true` **defaultNoteFileExtension** (QString): `md` **demoNotesCreated** (QString): `true` **disableAutomaticUpdateDialog** (QString): `true` **disableSavedSearchesAutoCompletion** (QString): `false` **dockWasInitializedOnce** (QString): `true` **enableNoteTree** (QString): `false` **enableSocketServer** (QString): `true` **enableWebAppSupport** (QString): `false` **externalEditorPath** (QString): *empty* **fullyHighlightedBlockquotes** (QString): `false` **gitCommitInterval** (int): `30` **gitExecutablePath** (QString): *empty* **gitLogCommand** (QString): *empty* **guiFirstRunInit** (QString): `true` **ignoreAllExternalModifications** (QString): `false` **ignoreAllExternalNoteFolderChanges** (QString): `false` **ignoreNoteSubFolders** (QString): `^\.` **ignoredNoteFiles** (QString): *empty* **imageScaleDown** (QString): `false` **imageScaleDownMaximumHeight** (int): `1024` **imageScaleDownMaximumWidth** (int): `1024` **initialLayoutIdentifier** (QString): `minimal` **insertTimeFormat** (QString): *empty* **interfaceFontSize** (int): `11` **interfaceLanguage** (QString): *empty* **internalIconTheme** (QString): `false` **itemHeight** (int): `15` **legacyLinking** (QString): `false` **localTrash/autoCleanupDays** (int): `30` **localTrash/autoCleanupEnabled** (QString): `true` **localTrash/supportEnabled** (QString): `true` **markdownHighlightingEnabled** (QString): `true` **navigationPanelAutoSelect** (QString): `true` **navigationPanelHideSearch** (QString): `false` **networking/ignoreSSLErrors** (QString): `false` **networking/proxyType** (int): `2` **newNoteAskHeadline** (QString): `false` **noteEditIsCentralWidget** (QString): `true` **noteFileExtensionList** (QStringList): `md, txt` **noteListPreview** (QString): `false` **noteSaveIntervalTime** (int): `10` **noteSubfoldersPanelDisplayAsFullTree** (QString): `true` **noteSubfoldersPanelHideSearch** (QString): `false` **noteSubfoldersPanelOrder** (int): `0` **noteSubfoldersPanelShowFullPath** (QString): `false` **noteSubfoldersPanelShowNotesRecursively** (QString): `false` **noteSubfoldersPanelShowRootFolderName** (QString): `true` **noteSubfoldersPanelSort** (int): `0` **notesPanelOrder** (int): `0` **notesPanelSort** (int): `1` **notesPath** (QString): `C:/Users/private/Nextcloud/Notes` **notifyAllExternalModifications** (QString): `false` **overrideInterfaceFontSize** (QString): `false` **ownCloud/supportEnabled** (QString): `true` **ownCloud/todoCalendarBackend** (int): `3` **ownCloud/todoCalendarCalDAVPassword** (QString): `` **ownCloud/todoCalendarCalDAVServerUrl** (QString): *empty* **ownCloud/todoCalendarCalDAVUsername** (QString): *empty* **ownCloud/todoCalendarCloudConnectionId** (int): `1` **ownCloud/todoCalendarDisplayNameList** (QStringList): *empty* **ownCloud/todoCalendarEnabledList** (QStringList): *empty* **ownCloud/todoCalendarEnabledUrlList** (QStringList): *empty* **ownCloud/todoCalendarUrlList** (QStringList): *empty* **ownCloudInfo/appIsValid** (QString): `true` **ownCloudInfo/connectionErrorMessage** (QString): `Unbekannter Fehler` **ownCloudInfo/notesPathExistsText** (QString): `yes` **ownCloudInfo/serverVersion** (QString): `24.0.5.1` **restoreCursorPosition** (QString): `true` **restoreLastNoteAtStartup** (QString): `true` **restoreNoteTabs** (QString): `true` **savedSearches/noteFolder-1** (QStringList): `Note 2022-10-02T20.28.47` **showMatches** (QString): `true` **showMenuBar** (QString): `true` **showStatusBar** (QString): `true` **systemIconTheme** (QString): `false` **taggingShowNotesRecursively** (QString): `false` **tagsPanelHideNoteCount** (QString): `false` **tagsPanelHideSearch** (QString): `false` **tagsPanelOrder** (int): `0` **tagsPanelSort** (int): `0` **todoCalendarSupport** (QString): `false` **toolbar/1/items** (QStringList): `action_New_note, action_Find_note, action_Remove_note, action_Open_note_in_external_editor, actionShow_local_trash, actionAllow_note_editing, , action_Back_in_note_history, action_Forward_in_note_history, , action_Find_text_in_note, actionReplace_in_current_note, , actionShow_versions, actionShow_trash, actionShare_note, , actionShow_Todo_List` **toolbar/1/name** (QString): `mainToolBar` **toolbar/1/title** (QString): `Hauptsymbolleiste` **toolbar/2/items** (QStringList): `actionFormat_text_bold, actionFormat_text_italic, actionStrike_out_text, actionInsert_code_block, actionInsert_block_quote` **toolbar/2/name** (QString): `formattingToolbar` **toolbar/2/title** (QString): `Formatierungs-Werkzeugleiste` **toolbar/3/items** (QStringList): `actionInsert_text_link, actionInsert_image, actionInsert_current_time` **toolbar/3/name** (QString): `insertingToolbar` **toolbar/3/title** (QString): `Einfügen-Werkzeugleiste` **toolbar/4/items** (QStringList): `action_Encrypt_note, actionEdit_encrypted_note, actionDecrypt_note` **toolbar/4/name** (QString): `encryptionToolbar` **toolbar/4/title** (QString): `Verschlüsselung-Werkzeugleiste` **toolbar/5/items** (QStringList): `actionWorkspaceComboBox, actionStore_as_new_workspace, actionRemove_current_workspace, actionRename_current_workspace, actionSwitch_to_previous_workspace, actionUnlock_panels, , actionToggle_distraction_free_mode, action_Increase_note_text_size, action_Decrease_note_text_size, action_Reset_note_text_size` **toolbar/5/name** (QString): `windowToolbar` **toolbar/5/title** (QString): `Fenster-Werkzeugleiste` **toolbar/6/items** (QStringList): `action_Quit` **toolbar/6/name** (QString): `quitToolbar` **toolbar/6/title** (QString): `Beenden - Symbolleiste` **toolbar/size** (int): `6` **useNoteFolderButtons** (QString): `false` **useUNIXNewline** (QString): `false` **webAppClientService/serverUrl** (QString): `wss://app.qownnotes.org` **webAppClientService/token** (QString): `` **webSocketServerService/bookmarksNoteName** (QString): `Bookmarks` **webSocketServerService/bookmarksTag** (QString): `bookmarks` **webSocketServerService/commandSnippetsNoteName** (QString): `Commands` **webSocketServerService/commandSnippetsTag** (QString): `commands` **webSocketServerService/port** (int): `22222` **workspace-initial/name** (QString): `Minimal` **workspace-initial/noteSubFolderDockWidgetVisible** (QString): `true` **workspace-initial/windowState** (QByteArray): `` **workspaces** (QStringList): `initial` ## System environment **ALLUSERSPROFILE**: `C:\ProgramData` **APPDATA**: `C:\Users\Private\AppData\Roaming` **ChocolateyInstall**: `C:\ProgramData\chocolatey` **ChocolateyLastPathUpdate**: `133076476210452980` **ChocolateyToolsLocation**: `C:\tools` **CommonProgramFiles**: `C:\Program Files\Common Files` **CommonProgramFiles(x86)**: `C:\Program Files (x86)\Common Files` **CommonProgramW6432**: `C:\Program Files\Common Files` **COMPUTERNAME**: `Private-PC` **ComSpec**: `C:\WINDOWS\system32\cmd.exe` **devmgr_show_nonpresent_devices**: `1` **DriverData**: `C:\Windows\System32\Drivers\DriverData` **FPS_BROWSER_APP_PROFILE_STRING**: `Internet Explorer` **FPS_BROWSER_USER_PROFILE_STRING**: `Default` **HOMEDRIVE**: `C:` **HOMEPATH**: `\Users\private` **JAVA_HOME**: `C:\Program Files\OpenJDK\openjdk-11.0.16_8` **JD2_HOME**: `C:\Users\Private\AppData\Local\JDownloader v2.0` **LOCALAPPDATA**: `C:\Users\Private\AppData\Local` **LOGONSERVER**: `\\Private-PC` **NUMBER_OF_PROCESSORS**: `12` **NUMLOCK**: `ON` **OS**: `Windows_NT` **Path**: `C:\Program Files\Eclipse Adoptium\jdk-11.0.16.101-hotspot\bin;C:\Program Files\Eclipse Adoptium\jdk-11.0.16.8-hotspot\bin;C:\Program Files (x86)\VMware\VMware Workstation\bin\;C:\Users\Private\AppData\Local\Programs\Python\Python39\Scripts\;C:\Users\Private\AppData\Local\Programs\Python\Python39\;C:\Python310\Scripts\;C:\Python310\;c:\windows\system32;c:\windows;c:\windows\system32\wbem;c:\windows\system32\windowspowershell\v1.0\;c:\programdata\chocolatey\bin;c:\users\Private\appdata\local\microsoft\windowsapps;C:\Program Files\dotnet\;C:\tools\BCURRAN3;C:\tools\gsudo\Current;C:\Program Files\Microsoft VS Code\bin;C:\Program Files\Solidigm\Solidigm(TM) Storage Tool\;C:\Program Files (x86)\Pulse Secure\VC142.CRT\X64\;C:\Program Files (x86)\Pulse Secure\VC142.CRT\X86\;C:\Program Files (x86)\Common Files\Pulse Secure\TNC Client Plugin\;C:\Program Files\PowerShell\7\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\ProgramData\chocolatey\bin;C:\Users\Private\AppData\Local\Microsoft\WindowsApps;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Users\Private\adb;C:\Users\Private\AppData\Local\GitHubDesktop\bin;C:\Users\Private\AppData\Local\Programs\Fiddler;C:\Users\Private\AppData\Local\Microsoft\WindowsApps;C:\Program Files (x86)\Nmap;` **PATHEXT**: `.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.PY;.PYW` **POWERSHELL_DISTRIBUTION_CHANNEL**: `MSI:Windows 10 Pro` **PROCESSOR_ARCHITECTURE**: `AMD64` **PROCESSOR_IDENTIFIER**: `AMD64 Family 23 Model 113 Stepping 0, AuthenticAMD` **PROCESSOR_LEVEL**: `23` **PROCESSOR_REVISION**: `7100` **ProgramData**: `C:\ProgramData` **ProgramFiles**: `C:\Program Files` **ProgramFiles(x86)**: `C:\Program Files (x86)` **ProgramW6432**: `C:\Program Files` **PSModulePath**: `C:\Program Files\WindowsPowerShell\Modules;C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules;C:\Program Files\Microsoft Message Analyzer\PowerShell\` **PUBLIC**: `C:\Users\Public` **SESSIONNAME**: `Console` **SystemDrive**: `C:` **SystemRoot**: `C:\WINDOWS` **TEMP**: `C:\Users\Private\AppData\Local\Temp` **TMP**: `C:\Users\Private\AppData\Local\Temp` **USERDOMAIN**: `Private-PC` **USERDOMAIN_ROAMINGPROFILE**: `Private-PC` **USERNAME**: `Private` **USERPROFILE**: `C:\Users\Private` **windir**: `C:\WINDOWS`
pbek commented 1 year ago

Currently the attachment names are detected from the Enex export and used as base for attachments in QOwnNotes... All attachments that have no filename in the enex will be imported with generic names.

See: https://github.com/pbek/QOwnNotes/blob/1208eacb76c443763c0405c73532bdf11bb77bca/src/dialogs/evernoteimportdialog.cpp#L358-L360

Do you have an example Enex where that doesn't work?

Gedankenleser commented 1 year ago

Here is a example file. (Test.zip) Exported from Evernote 10.45.18-win-ddl-public (3683) Editor: V 157.1.19252 Service: V 1.57.5

QownNotes Debug-Log: [19:56:52] [debug] handleNoteTextFileName - 'name' was changed: "Test" [19:56:52] [debug] storing note file: "Test.md" [19:56:58] [debug] buildNotesIndex - 'noteSubFolderId': 0 [19:56:58] [debug] setupNoteFolderTables - 'database version': 15 [19:56:58] [debug] cloudConnection: CloudConnection: 1 "Standard" "https://private.private.de" "private" "private" 1 [19:56:58] [debug] fetchShares - 'url': QUrl("https://private.private.de/ocs/v2.php/apps/files_sharing/api/v1/shares") [19:56:58] [debug] loadNoteDirectoryList [19:56:58] [debug] reloadTagTree [19:56:58] [debug] reloadTagTree - 'noteSubFolderIds': QVector(0) [19:56:58] [debug] filterNotesByNoteSubFolders - 'noteSubFolderIds': QVector(0) [19:56:58] [debug] reloadNoteSubFolderTree [19:56:58] [debug] reload [19:56:58] [debug] filterNotesByNoteSubFolders - 'noteSubFolderIds': QVector(0) [19:56:58] [debug] Reply from "/ocs/v2.php/apps/files_sharing/api/v1/shares" [19:56:58] [debug] Reply from share api [19:56:58] [debug] updateNoteShareStatusFromShare - 'status': "ok\n"

pbek commented 1 year ago

I haven't managed to get the attachment out of Test.enex yet altogether... Have to play around with it later. 😉

pbek commented 1 year ago

After getting around an issue to get the attachment at all I was able to import the file... As it turns out the filename really wasn't used for file-name safety, it is only used in the title of the link.

pbek commented 1 year ago

I'll try to get around that.

pbek commented 1 year ago

Took longer to implement than expected...

22.10.1

pbek commented 1 year ago

There now is a new release, could you please test it and report if it works for you?

Gedankenleser commented 1 year ago

Works! Thx!

pbek commented 1 year ago

Great, thank you for testing!