From 08a3c34cb97b8512c44cc13f886dcedfa1b6a378 Mon Sep 17 00:00:00 2001 From: Hydrus Network Developer Date: Wed, 26 Oct 2022 15:43:00 -0500 Subject: [PATCH] Version 504 --- .github/workflows/release.yml | 234 +----- docs/changelog.md | 71 +- docs/old_changelog.html | 49 ++ docs/running_from_source.md | 4 +- hydrus/client/ClientController.py | 17 + hydrus/client/ClientOptions.py | 57 +- hydrus/client/ClientStrings.py | 6 +- hydrus/client/db/ClientDB.py | 34 + hydrus/client/db/ClientDBFilesStorage.py | 5 + hydrus/client/db/ClientDBMaintenance.py | 2 +- hydrus/client/db/ClientDBModule.py | 5 + .../client/exporting/ClientExportingFiles.py | 6 +- .../exporting/ClientExportingMetadata.py | 321 --------- hydrus/client/gui/ClientGUI.py | 10 +- hydrus/client/gui/ClientGUIDialogsQuick.py | 2 + .../gui/ClientGUIScrolledPanelsReview.py | 13 +- hydrus/client/gui/ClientGUITime.py | 2 + .../gui/{ => exporting}/ClientGUIExport.py | 235 ++---- hydrus/client/gui/exporting/__init__.py | 1 + .../client/gui/importing/ClientGUIImport.py | 210 ++++-- .../gui/importing/ClientGUIImportFolders.py | 21 +- hydrus/client/gui/lists/ClientGUIListBoxes.py | 5 + .../metadata/ClientGUIMetadataMigration.py | 242 +++++++ .../ClientGUIMetadataMigrationExporters.py | 368 ++++++++++ .../ClientGUIMetadataMigrationImporters.py | 394 ++++++++++ hydrus/client/gui/metadata/__init__.py | 1 + .../client/gui/pages/ClientGUIManagement.py | 5 +- hydrus/client/gui/pages/ClientGUIPages.py | 8 + hydrus/client/gui/pages/ClientGUIResults.py | 2 +- .../client/gui/search/ClientGUIACDropdown.py | 25 + hydrus/client/gui/search/ClientGUILocation.py | 1 + hydrus/client/importing/ClientImportLocal.py | 224 +++++- .../importing/options/TagImportOptions.py | 35 +- .../metadata/ClientMetadataMigration.py | 206 ++++++ .../metadata/ClientMetadataMigrationCore.py | 60 ++ .../ClientMetadataMigrationExporters.py | 404 +++++++++++ .../ClientMetadataMigrationImporters.py | 513 +++++++++++++ hydrus/core/HydrusConstants.py | 2 +- hydrus/core/HydrusLogger.py | 1 - hydrus/core/HydrusSerialisable.py | 10 +- hydrus/core/networking/HydrusNetwork.py | 1 - hydrus/core/networking/HydrusNetworkLegacy.py | 6 - .../HydrusNetworkVariableHandling.py | 2 - hydrus/core/networking/HydrusNetworking.py | 4 - hydrus/test/HelperFunctions.py | 16 + hydrus/test/TestClientDB.py | 2 +- hydrus/test/TestClientMetadataMigration.py | 680 ++++++++++++++++++ hydrus/test/TestController.py | 8 +- requirements_old_mpv.txt | 28 + .../default/gugs/deviant art tag search.png | Bin 1776 -> 0 bytes static/hydrus_128.ico | Bin 0 -> 19518 bytes 51 files changed, 3642 insertions(+), 916 deletions(-) delete mode 100644 hydrus/client/exporting/ClientExportingMetadata.py rename hydrus/client/gui/{ => exporting}/ClientGUIExport.py (80%) create mode 100644 hydrus/client/gui/exporting/__init__.py create mode 100644 hydrus/client/gui/metadata/ClientGUIMetadataMigration.py create mode 100644 hydrus/client/gui/metadata/ClientGUIMetadataMigrationExporters.py create mode 100644 hydrus/client/gui/metadata/ClientGUIMetadataMigrationImporters.py create mode 100644 hydrus/client/gui/metadata/__init__.py create mode 100644 hydrus/client/metadata/ClientMetadataMigration.py create mode 100644 hydrus/client/metadata/ClientMetadataMigrationCore.py create mode 100644 hydrus/client/metadata/ClientMetadataMigrationExporters.py create mode 100644 hydrus/client/metadata/ClientMetadataMigrationImporters.py create mode 100644 hydrus/test/HelperFunctions.py create mode 100644 hydrus/test/TestClientMetadataMigration.py create mode 100644 requirements_old_mpv.txt delete mode 100644 static/default/gugs/deviant art tag search.png create mode 100644 static/hydrus_128.ico diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index aa82edcf..c6778b51 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,63 +5,6 @@ on: - 'v*' jobs: - build-macos-Qt5: - runs-on: macos-11 - steps: - - - name: Checkout - uses: actions/checkout@v3 - - - name: Setup FFMPEG - uses: FedericoCarboni/setup-ffmpeg@v1.1.0 - id: setup_ffmpeg - with: - token: ${{ secrets.GITHUB_TOKEN }} - - - name: Install mkdocs-material - run: python3 -m pip install mkdocs-material - - - name: Build docs to /help - run: mkdocs build -d help - - - name: Install PyOxidizer - run: python3 -m pip install pyoxidizer - - - name: Build Hydrus - run: | - cd $GITHUB_WORKSPACE - cp ${{ steps.setup_ffmpeg.outputs.ffmpeg-path }} bin/ - cp static/build_files/macos/pyoxidizer.bzl pyoxidizer.bzl - cp static/build_files/macos/requirementsQt5.txt requirements.txt - basename $(rustc --print sysroot) | sed -e "s/^stable-//" > triple.txt - pyoxidizer build --release - cd build/$(head -n 1 triple.txt)/release - mkdir -p "Hydrus Network.app/Contents/MacOS" - mkdir -p "Hydrus Network.app/Contents/Resources" - mkdir -p "Hydrus Network.app/Contents/Frameworks" - mv install/static/icon.icns "Hydrus Network.app/Contents/Resources/icon.icns" - cp install/static/build_files/macos/Info.plist "Hydrus Network.app/Contents/Info.plist" - cp install/static/build_files/macos/ReadMeFirst.rtf ./ReadMeFirst.rtf - cp install/static/build_files/macos/running_from_app "install/running_from_app" - ln -s /Applications ./Applications - mv install/* "Hydrus Network.app/Contents/MacOS/" - rm -rf install - - - name: Build DMG - run: | - cd $GITHUB_WORKSPACE - temp_dmg="$(mktemp).dmg" - hdiutil create "$temp_dmg" -ov -volname "HydrusNetwork" -fs HFS+ -format UDZO -srcfolder "$GITHUB_WORKSPACE/build/$(head -n 1 triple.txt)/release" - mv "$temp_dmg" HydrusNetwork5.dmg - - - name: Upload a Build Artifact - uses: actions/upload-artifact@v3 - with: - name: MacOS-DMG5 - path: HydrusNetwork5.dmg - if-no-files-found: error - retention-days: 2 - build-macos-Qt6: runs-on: macos-11 steps: @@ -119,78 +62,6 @@ jobs: if-no-files-found: error retention-days: 2 - build-ubuntu-Qt5: - runs-on: ubuntu-18.04 - steps: - - - name: Checkout - uses: actions/checkout@v3 - with: - path: hydrus - - - name: Setup Python - uses: actions/setup-python@v4 - with: - python-version: 3.8 - architecture: x64 - - - name: APT Install - run: | - sudo apt-get update - sudo apt-get install -y libmpv1 - - - name: Pip Install - run: python3 -m pip install -r hydrus/static/build_files/linux/requirementsQt5.txt - - - name: Build docs to /help - run: mkdocs build -d help - working-directory: hydrus - #- name: Cache Qt - # id: cache-qt - # uses: actions/cache@v1 - # with: - # path: Qt - # key: ${{ runner.os }}-QtCache - #- - # name: Install Qt - # uses: jurplel/install-qt-action@v2 - # with: - # install-deps: true - # setup-python: 'false' - # modules: qtcharts qtwidgets qtgui qtcore - # cached: ${{ steps.cache-qt.outputs.cache-hit }} - - - name: Build Hydrus - run: | - cp hydrus/static/build_files/linux/client.spec client.spec - cp hydrus/static/build_files/linux/server.spec server.spec - pyinstaller server.spec - pyinstaller client.spec - - - name: Remove Chonk - run: | - find dist/client/ -type f -name "*.pyc" -delete - while read line; do find dist/client/ -type f -name "${line}" -delete ; done < hydrus/static/build_files/linux/files_to_delete.txt - - - name: Set Permissions - run: | - sudo chown --recursive 1000:1000 dist/client - sudo find dist/client -type d -exec chmod 0755 {} \; - sudo chmod +x dist/client/client dist/client/server dist/client/bin/swfrender_linux - - - name: Compress Client - run: | - mv dist/client "dist/Hydrus Network" - tar -czvf Ubuntu-Extract5.tar.gz -C dist "Hydrus Network" - - - name: Upload a Build Artifact - uses: actions/upload-artifact@v3 - with: - name: Ubuntu-Extract5 - path: Ubuntu-Extract5.tar.gz - if-no-files-found: error - retention-days: 2 - build-ubuntu-Qt6: runs-on: ubuntu-20.04 steps: @@ -267,87 +138,6 @@ jobs: if-no-files-found: error retention-days: 2 - build-windows-Qt5: - runs-on: windows-2019 - steps: - - - name: Checkout - uses: actions/checkout@v3 - with: - path: hydrus - - - name: Setup FFMPEG - uses: FedericoCarboni/setup-ffmpeg@v1.1.0 - id: setup_ffmpeg - with: - token: ${{ secrets.GITHUB_TOKEN }} - - - name: Setup Python - uses: actions/setup-python@v4 - with: - python-version: 3.8 - architecture: x64 - - - name: Pip Install - run: python3 -m pip install -r hydrus/static/build_files/windows/requirementsQt5.txt - - - name: Build docs to /help - run: mkdocs build -d help - working-directory: hydrus - #- - # name: Cache Qt - # id: cache_qt - # uses: actions/cache@v1 - # with: - # path: ../Qt - # key: ${{ runner.os }}-QtCache - #- - # name: Install Qt - # uses: jurplel/install-qt-action@v2 - # with: - # install-deps: true - # setup-python: 'false' - # modules: qtcharts qtwidgets qtgui qtcore - # cached: ${{ steps.cache_qt.outputs.cache-hit }} - - - name: Download mpv-dev - uses: carlosperate/download-file-action@v1.1.1 - id: download_mpv - with: - file-url: 'https://sourceforge.net/projects/mpv-player-windows/files/libmpv/mpv-dev-x86_64-20210228-git-d1be8bb.7z' - file-name: 'mpv-dev-x86_64.7z' - location: '.' - - - name: Process mpv-dev - run: | - 7z x ${{ steps.download_mpv.outputs.file-path }} - move mpv-1.dll hydrus\ - - - name: Build Hydrus - run: | - move ${{ steps.setup_ffmpeg.outputs.ffmpeg-path }} hydrus\bin\ - move hydrus\static\build_files\windows\sqlite3.dll hydrus\ - move hydrus\static\build_files\windows\sqlite3.exe hydrus\db - move hydrus\static\build_files\windows\client-winQt5.spec client-win.spec - move hydrus\static\build_files\windows\server-win.spec server-win.spec - pyinstaller server-win.spec - pyinstaller client-win.spec - dir -r - - - name: Compress Client - run: | - cd .\dist - 7z.exe a -tzip -mm=Deflate -mx=5 ..\Windows-Extract5.zip 'Hydrus Network' - cd .. - - - name: Upload a Build Artifact - uses: actions/upload-artifact@v3 - with: - name: Windows-Extract5 - path: Windows-Extract5.zip - if-no-files-found: error - retention-days: 2 - build-windows-Qt6: runs-on: windows-2019 steps: @@ -447,7 +237,7 @@ jobs: create-release: name: Create Release Entry runs-on: ubuntu-20.04 - needs: [build-windows-Qt5, build-windows-Qt6, build-ubuntu-Qt5, build-ubuntu-Qt6, build-macos-Qt5, build-macos-Qt6] + needs: [build-windows-Qt6, build-ubuntu-Qt6, build-macos-Qt6] steps: - name: Checkout code @@ -465,25 +255,19 @@ jobs: name: Rename Files run: | mkdir ubuntu windows - mv MacOS-DMG5/HydrusNetwork5.dmg Hydrus.Network.${{ env.version_short }}.-.macOS.Qt5.-.App.dmg - mv MacOS-DMG6/HydrusNetwork6.dmg Hydrus.Network.${{ env.version_short }}.-.macOS.Qt6.-.App.dmg - mv Windows-Install/HydrusInstaller.exe Hydrus.Network.${{ env.version_short }}.-.Windows.Qt6.-.Installer.exe - mv Windows-Extract5/Windows-Extract5.zip Hydrus.Network.${{ env.version_short }}.-.Windows.Qt5.-.Extract.only.zip - mv Windows-Extract6/Windows-Extract6.zip Hydrus.Network.${{ env.version_short }}.-.Windows.Qt6.-.Extract.only.zip - mv Ubuntu-Extract5/Ubuntu-Extract5.tar.gz Hydrus.Network.${{ env.version_short }}.-.Linux.Qt5.-.Executable.tar.gz - mv Ubuntu-Extract6/Ubuntu-Extract6.tar.gz Hydrus.Network.${{ env.version_short }}.-.Linux.Qt6.-.Executable.tar.gz + mv Windows-Install/HydrusInstaller.exe Hydrus.Network.${{ env.version_short }}.-.Windows.-.Installer.exe + mv Windows-Extract6/Windows-Extract6.zip Hydrus.Network.${{ env.version_short }}.-.Windows.-.Extract.only.zip + mv Ubuntu-Extract6/Ubuntu-Extract6.tar.gz Hydrus.Network.${{ env.version_short }}.-.Linux.-.Executable.tar.gz + mv MacOS-DMG6/HydrusNetwork6.dmg Hydrus.Network.${{ env.version_short }}.-.macOS.-.App.dmg - name: Release new uses: softprops/action-gh-release@v1 if: startsWith(github.ref, 'refs/tags/') with: files: | - Hydrus.Network.${{ env.version_short }}.-.Windows.Qt6.-.Installer.exe - Hydrus.Network.${{ env.version_short }}.-.Windows.Qt5.-.Extract.only.zip - Hydrus.Network.${{ env.version_short }}.-.Windows.Qt6.-.Extract.only.zip - Hydrus.Network.${{ env.version_short }}.-.Linux.Qt5.-.Executable.tar.gz - Hydrus.Network.${{ env.version_short }}.-.Linux.Qt6.-.Executable.tar.gz - Hydrus.Network.${{ env.version_short }}.-.macOS.Qt5.-.App.dmg - Hydrus.Network.${{ env.version_short }}.-.macOS.Qt6.-.App.dmg + Hydrus.Network.${{ env.version_short }}.-.Windows.-.Installer.exe + Hydrus.Network.${{ env.version_short }}.-.Windows.-.Extract.only.zip + Hydrus.Network.${{ env.version_short }}.-.Linux.-.Executable.tar.gz + Hydrus.Network.${{ env.version_short }}.-.macOS.-.App.dmg env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/docs/changelog.md b/docs/changelog.md index 9d2feb75..5adda75e 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -7,6 +7,55 @@ title: Changelog !!! note This is the new changelog, only the most recent builds. For all versions, see the [old changelog](old_changelog.html). +## [Version 504](https://github.com/hydrusnetwork/hydrus/releases/tag/v504) + +### Qt5 +* as a reminder, I am no longer supporting Qt5 with the official builds. if you are on Windows 7 (and I have heard at least one version of Win 8.1), or a similarly old OS, you likely cannot run the official builds now. if this is you, please check the 'running from source' guide in the help, which will allow you to keep updating the program. this process is now easy in Windows and should be similarly easy on other platforms soon + +### misc +* if you run from source in windows, the program _should_ now have its own taskbar group and use the correct hydrus icon. if you try and pin it to taskbar, it will revert to the 'python' icon, but you can give a shortcut to a batch file an icon and pin that to start +* unfortunately, I have to remove the 'deviant art tag search' downloader this week. they killed the old API we were using, and what remaining open date-paginated search results the site offers is obfuscated and tokenised (no permanent links), more than I could quickly unravel. other downloader creators are welcome to give it a go. if you have a subscription for a da tag search, it will likely complain on its next run. please pause it and try to capture the best artists from that search (until DA kill their free artist api, then who knows what will happen). the oauth/phone app menace marches on +* focus on the thumbnail panel is now preserved whenever it swaps out for another (like when you refresh the search) +* fixed an issue where cancelling service selection on database->c&r->repopulate truncated would create an empty modal message +* fixed a stupid typo in the recently changed server petition counting auto-fixing code + +### importer/exporter sidecar expansion +* when you import or export files from/to disk, either manually or automatically, the option to pull or send tags to .txt files is now expanded: +* - you can now import or export URLs +* - you can now read or write .json files +* - you can now import from or export to multiple sidecars, and have multiple separate pipelines +* - you can now give sidecar files suffixes, for ".tags.txt" and similar +* - you can now filter and transform all the strings in this pipeline using the powerful String Processor just like in the parsing system +* this affects manual imports, manual exports, import folders, and export folders. instead of smart .txt checkboxes, there's now a button leading to some nested dialogs to customise your 'routers' and, in manual imports, a new page tab in the 'add tags before import' window +* this bones of this system was already working in the background when I introduced it earlier this year, but now all components are exposed +* new export folders now start with the same default metadata migration as set in the last manual file export dialog +* this system will expand in future. most important is to add a 'favourites' system so you can easily save/load your different setups. then adding more content types (e.g. ratings) and .xml. I'd also like to add purely internal file-to-itself datatype transformation (e.g. pulling url:(url) tags and converting them to actual known urls, and vice versa) + +### importer/exporter sidecar expansion (boring stuff) +* split the importer/exporter objects into separate importers and exporters. existing router objects will update and split their internal objects safely +* all objects in this system can now describe themselves +* all import/export nodes now produce appropriate example texts for string processing and parsing UI test panels +* Filename Tagging Options objects no longer track neighbouring .txt file importing, and their UI removes it too. Import Folders will suck their old data on update and convert to metadata routers +* wrote a json sidecar importer that takes a parsing formula +* wrote a json sidecar exporter that takes a list of dictionary names to export to. it will edit an existing file +* wrote some ui panels to edit single file metadata migration routers +* wrote some ui panels to edit single file metadata migration importers +* wrote some ui panels to edit single file metadata migration exporters +* updated edit export folder panel to use the new UI. it was already using a full static version of the system behind the scenes; now this is exposed and editable +* updated the manual file export panel to use the new UI. it was using a half version of the system before--now the default options are updated to the new router object and you can create multiple exports +* updated import folders to use the new UI. the filename tagging options no longer handles .txt, it is now on a separate button on the import folder +* updated manual file imports to use the new UI. the 'add tags before import' window now has a 'sidecars' page tab, which lets you edit metadata routers. it updates a path preview list live with what it expects to parse +* a full suite of new unit tests now checks the router, the four import nodes, and the four export nodes thoroughly +* renamed ClientExportingMetadata to ClientMetadataMigration and moved to the metadata module. refactored the importers, exporters, and shared methods to their own files in the same module +* created a gui.metadata module for the new router and metadata import/export widgets and panels +* created a gui.exporting module for the existing export folder and manual export gui code +* reworked some of the core importer/exporter objects and inheritance in clientmetadatamigration +* updated the HDDImport object and creation pipeline to handle metadata routers (as piped from the new sidecars tab) +* when the hdd import or import folder is set to delete original files, now all defined sidecars are deleted along with the media file +* cleaned up a bunch of related metadata importer/exporter code +* cleaned import folder code +* cleaned hdd importer code + ## [Version 503](https://github.com/hydrusnetwork/hydrus/releases/tag/v503) ### misc @@ -391,25 +440,3 @@ _almost all the changes this week are only important to server admins and janito * fiddled with QPoint and QPointF conversions a little so I _think_ Qt5 and Qt6 is always talking about the same type * updated build scripts and requirements.txts for the new situation * updated the help a bit for the new situation - -## [Version 493](https://github.com/hydrusnetwork/hydrus/releases/tag/v493) - -### EXIF -* in the first step of 'official' EXIF support, the media viewer now has a 'cog' button on the top hover, enabled when looking at a jpeg, that will check the file for EXIF data. if found, it will throw it up on a simple new window that shows EXIF id, label, and value. this is a hacked-together prototype, not super user-friendly, but it works. let me know what you think, and please send me any files that have weird EXIF that doesn't parse right but you think should. I already discovered a file with a null character that wouldn't display in UI, that sort of thing -* GPS EXIF values are also parsed and extracted -* made it so you can double-click a row in this new window to copy an EXIF value to clipboard -* in the duplicate filter, if one or both files have exif data, this is now noted in the comparison statements, just like ICC profile! (issue #469) -* obvious future extensions here will be storing 'has exif' in the database and allowing its presence to be searchable and enabling the cog button (or a nicer 'exif' button) only when there is known data to see. a subsequent step would be actually caching the data in the database for full EXIF search -* as a side thing, we're now set up on the hydrus end to pull TIFF EXIF, but PIL doesn't seem to offer it, so we'll have to wait for a different solution there - -### fixes and misc -* fixed a problem that made saved page file sorts reset their sort order one time on update to v492. thank you to a user for noticing this and discovering the fix, and I'm very sorry for the inconvenience of changing your session and favourite search sorts. unfortunately there is no easy fix other than rolling back to a backup and jumping forward to this version -* fixed a v492 message display error when setting various duplicate relationships to three or more thumbnails at once. it was a stupid typo, sorry for the trouble! (issue #1199) -* if a page tab name elides to a 'shorter...' length, it now has its full name as the tooltip -* fixed a typo in update code error handling (issue #1192) -* the duplicate filter page now remembers if you are 'searching immediately'/'search paused' (issue #1193) -* if you are on non-Windows and export files manually or with an export folder to an NTFS or exFAT partition, this is now detected, and NTFS-invalid characters in the pattern-generated folders or filename are now replaced with underscores (issue #1194) -* 'fixed' a system predicate bug in the 'OR*' advanced predicate parser--entering a logical expression that results in a negated system tag now causes an error. previously, it would strip the 'system:' and just enter the given text as an unnamespaced tag. furthermore, that dialog now reports specific error reasons when it fails to parse. I hope to improve support for negated system tags in future--some stuff, like archive/inbox, should be easy. -* I think I fixed an instance where the archive/delete filter's confirmation dialog could present 'delete from hard disk' as an option when it wasn't appropriate -* in an attempt to reduce the media-change flickering we've recently seen in the media viewer, I untangled a bunch of the canvas size/position code this week. I'm preparing a complete overhaul and neat Qt layout integration, which this starts. I _think_ I've made some things less flickery on occasion, but we'll see IRL. much more to do -* added a '--profile_mode' launch argument, which allows you to capture the performance of boot and also try out profile mode on the server (although support there is very limited atm) diff --git a/docs/old_changelog.html b/docs/old_changelog.html index 22dcbf2c..bb010901 100644 --- a/docs/old_changelog.html +++ b/docs/old_changelog.html @@ -33,6 +33,55 @@

changelog