Commit graph

56 commits

Author SHA1 Message Date
Kornelius Rohrschneider 90ed829375
Added existing export search
Previously, an existing export could only be detected if it existed at the current file target path.
However, if the name of the channel, the channel parent or the guild has changed or if the default file name formatting has changed, the existing export's file name would be different, and it could therefore not be detected.
Therefore, the option to explicitly search for the existing export in the target directory has been added.
If it's activated (and there's no existing export at the current file target path), all file names in the target directory will be compared to a regex that matches any file name the channel export (with the same date range) might have had in the past.
If several existing exports have been detected, an error is logged and the channel export is aborted. Otherwise, it continues as before (only additionally moving the existing export files to the to the new file paths if they should be appended).
Whether this new option is activated is currently hardcoded.
The enum FileExistsHandling has been renamed to ExportExistsHandling to clarify that the setting applies to existing exports in general.

If file names of a directory are needed, they are collected lazily and stored for future use in other channel exports to avoid unnecessary I/O operations.
2025-10-30 00:04:37 +01:00
Kornelius Rohrschneider 4461a53f8b
Added an export progress logger
An export progress logger has been added to the exporter. It provides a consistent way to log the entire process of an export, meaning all status updates of each of the exported channels. It also allows to count the different results of the individual channel exports and can provide a summary of them.
There are two subclasses: The ConsoleProgressLogger logs the status updates with colors on the console while the SnackbarProgressLogger logs them in the GUI snackbar.

Previously, two exceptions had been used to signalize "warnings" and "errors", and respective messages had been displayed (GUI) respectively collected and displayed after the export finished (CLI) upon catching them.
Individual counts had been used to display an export summary message after the export finished.

The new logging system has numerous advantages:
- It allows logging status updates during a channel export (without having to abort it). Therefore, it also allows for informational messages, success messages and (non-urgent) warning messages to be logged.
- It doesn't use exceptions in situations without any need for exceptional handling, resulting in cleaner code.
- It logs all these messages instantly on both the CLI and GUI, instead of only displaying the log messages after the export finished.
- It removes duplicated code structures between the CLI and GUI parts; replacing individual logging / counting code with a general consistent logger / counter, which improves the code quality.
- This also makes it handle the logging much more consistently: Not only are the messages logged in the general export codebase, but their appearance and formatting are now defined together in a single place, making the logging system much more consistent and maintainable.

Using the new system, many informational messages and warning messages have been added to the export process. This particularly includes messages about the handling of existing export files that had been added provisionally with Console.WriteLine.
The existing messages have also been made more consistent with each other.
Furthermore, the logging of success messages has been added to the exporter. This allows the user to better watch the progress in the GUI and solves the problem that the progress hadn't been watchable in the CLI if parallel exports had been enabled.

The export summary message has also been massively improved:
While previously, it had just contained the number of channels that have been successfully exported, the handling of existing export files has added other possible export results, specifically the channel having already been exported and being appended or overwritten successfully, and the channel having already been exported and not having been appended as there are no new messages.
Therefore, the export summary has been changed to contain the number of channel exports that resulted in each occurring export result.
This also means that it now contains the number of empty new channel exports (which had previously not been included).
2025-10-28 02:34:21 +01:00
Kornelius Rohrschneider ad33600e70
Added UI options to set the file exists handling
The setting the exporter uses to handle existing export files has been made configurable in both the CLI and the GUI (instead of being hardcoded):
- A prev-export option has been added to all CLI export commands, which sets the file exists handling for the respective command.
- A Previous Export option has been added to the GUI settings, which sets the file exists handling that's used for exports.
2025-10-26 01:28:24 +02:00
Kornelius Rohrschneider 5251ae0e95
Added explicit handling of existing export files
Previously, existing export files had just been overwritten by a new export.
This has been changed; instead, there are now several possible options on how to explicitly handle existing export files:
- Abort aborts the export if the channel had previously been exported.
- Overwrite removes the existing export before exporting the channel again.
- Append appends the existing export, which means that only messages after the last export will be exported.
The option that's used if a previous export is detected is currently hardcoded.

A safeguard has been added to prevent the exporter from accidentally overwriting any existing files.

Additionally, the creation of a Snowflake from a timestamp has been improved: If a Snowflake will be used to determine the messages starting at the given timestamp, it now won't precisely represent that timestamp anymore, but instead be the latest possible Snowflake just before that timestamp.
This is necessary to prevent the first Discord message in that specific millisecond from being excluded (which may have previously happened).
2025-10-25 19:17:00 +02:00
Tyrrrz 845e2a52fe Fix guilds -> servers 2025-07-09 01:10:56 +03:00
Tyrrrz 92ee97a5da Clean up 2025-05-12 23:22:54 +03:00
Oleksii Holub 612ae2e894
Add a setting to control whether to respect advisory rate limits (#1342) 2025-05-12 19:52:47 +03:00
Tyrrrz 6fb197cf0b Refactor 2025-04-02 00:34:52 +03:00
Leonardo Mosquera 7add81a472
Don't consider it an error if there is nothing to export (#1349) 2025-04-02 00:14:35 +03:00
Tyrrrz deca3fc1bf Use partial properties 2025-03-18 20:06:44 +02:00
Tyrrrz 1fb6156187 Refactor 2024-11-06 19:36:34 +02:00
Tyrrrz 09e0b3f133 Format stuff 2024-10-26 21:41:16 +03:00
Oleksii Holub 429801183c
Warn when using development build (#1248) 2024-06-01 00:58:24 +03:00
Oleksii Holub b9c1c47474
Migrate to Avalonia (#1220) 2024-04-27 04:17:46 +03:00
Tyrrrz 4e3deb409c Update NuGet packages 2023-12-29 00:08:16 +02:00
Tyrrrz e89701e3f9 Provide more context in exception messages 2023-11-16 21:10:24 +02:00
Tyrrrz 4896d748aa Update NuGet packages 2023-11-09 13:06:00 +02:00
Tyrrrz 5abe74894c Remove Channel.ParentNameWithFallback 2023-09-07 16:36:29 +03:00
Oleksii Holub 59344cedbe
Replace the date format option with a locale option (#1130) 2023-09-07 14:34:08 +03:00
Tyrrrz c422ac2351 Clean up 2023-08-30 18:43:12 +03:00
Tyrrrz 3740d64601 Optimize thread inclusion UX across GUI and CLI
Related to #1119
2023-08-28 22:08:51 +03:00
Tyrrrz 20f58963a6 Use CSharpier 2023-08-22 21:17:19 +03:00
Tyrrrz c410e745b1 Add rudimentary thread support in GUI
Related to #1119
2023-08-22 21:14:34 +03:00
Tyrrrz 67d41fbdc4 Fix jitter in the GUI when switching from DM guild to any other and back 2023-08-22 17:41:36 +03:00
Tyrrrz 47588296a9 Use ValueTask for consistency 2023-08-22 00:08:45 +03:00
Tyrrrz d1a8f466f6 Pull channels lazily in the GUI
Closes #1005
2023-08-22 00:03:29 +03:00
Tyrrrz ac1bd16439 Clean up 2023-08-21 01:05:57 +03:00
Tyrrrz 90d71c5b9e Clean up 2023-07-10 20:40:32 +03:00
Tyrrrz c4137cf77e Hide token using password box 2023-07-09 18:13:41 +03:00
Tyrrrz d779ed9bc8 Blur the token in GUI when the control is out of focus 2023-05-29 19:01:49 +03:00
Tyrrrz 31c7ae9312 Refactor 2023-05-20 07:09:19 +03:00
Tyrrrz 404542d973 Replace Tyrrrz.Settings with Cogwheel 2023-02-20 02:56:39 +02:00
Tyrrrz 0e1c3e4c76 Add support for extracting channels from data dump in exportall
Closes #597
2023-02-18 19:45:31 +02:00
Tyrrrz d1647e8286 Add support for selectable assets directory in GUI 2023-02-17 21:30:10 +02:00
Lucas LaBuff 95115f3e99
Add option to specify download directory for assets (#989)
Co-authored-by: Oleksii Holub <1935960+Tyrrrz@users.noreply.github.com>
2023-02-17 20:48:20 +02:00
Tyrrrz 6620c6299c Move "reuse assets" option in GUI from settings to export dialog 2023-02-15 22:59:08 +02:00
Tyrrrz 20a952aec5 Add option to disable markdown formatting
Closes #741
2023-02-15 22:55:17 +02:00
Tyrrrz c8d83beb8d Enhance output path selection in the GUI
Enables the use of template tokens when exporting multiple channels
Closes #676
2023-02-13 19:48:57 +02:00
Tyrrrz 1e7b8ec83f Show notification on first run after an update with a link to the changelog
Closes #487
2023-02-09 17:17:25 +02:00
Jacob P 597ec1e7b0
Move wiki inside the repository (#991)
Co-authored-by: Oleksii Holub <1935960+Tyrrrz@users.noreply.github.com>
2023-01-27 04:11:51 +02:00
Tyrrrz 560a069c35 Refactor, rename the concept of "download media" to "download assets", including related mentions 2022-10-29 17:39:53 +03:00
Oleksii Holub 6c039ebfa6 Filter out categories when displaying channels 2022-08-19 18:39:19 +03:00
Oleksii Holub 94ef4b6981 Support listing and exporting voice channels
Closes #874
2022-06-28 18:27:01 +03:00
Oleksii Holub 2463cb5087 Sort DMs by last message and avoid grouping them in GUI
Closes #271
2022-06-28 17:23:01 +03:00
Oleksii Holub 2c7986c4e6 Refactor IsTextChannel and IsVoiceChannel to extensions 2022-06-28 16:38:44 +03:00
Oleksii Holub 9341c21963 Add clickable links to usage guide in GUI 2022-04-09 02:31:52 +03:00
Oleksii Holub 2e4d19671a Append channel name for export errors in GUI 2022-04-09 02:01:19 +03:00
Oleksii Holub 91ea7a443c More cleanup 2022-04-06 19:12:27 +03:00
Oleksii Holub aea96d5eba Cleanup 2022-04-06 19:00:19 +03:00
Oleksii Holub e29f08264c Refactor portions of RootViewModel into DashboardViewModel 2022-04-04 01:34:46 +03:00