Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Sep 20, 2025

Removed the duplicate TgsExtractor.cs file from the Lottie folder as requested by @emako.

The file was incorrectly left in the Lottie folder during the refactoring process. Now only the correct version exists in the dedicated Tgs folder with the proper namespace.

Current Status

Structure Changes:

  • ✅ Created new QuickLook.Plugin.ImageViewer.Webview.Tgs namespace and folder structure
  • ✅ Moved TGS-specific functionality out of the Lottie folder
  • ✅ Reverted all modifications to Lottie classes (LottieDetector.cs, LottieExtractor.cs)
  • ✅ Removed duplicate TgsExtractor.cs from Lottie folder

TGS Classes (in Tgs folder):

  • TgsExtractor.cs - Handles gzip decompression for TGS files
  • TgsDetector.cs - Validates TGS files independently using TgsExtractor and LottieParser
  • TgsMetaProvider.cs - Provides metadata for TGS files
  • TgsImagePanel.cs - Handles TGS file rendering using Lottie infrastructure

WebHandler Updates:

  • Added Tgs namespace import
  • Updated TryCanHandle to use TgsDetector.IsValid() for .tgs files specifically
  • Updated TryPrepare to use TgsMetaProvider for .tgs files
  • Updated TryView to use TgsImagePanel for .tgs files

This maintains complete separation between TGS and Lottie functionality while still leveraging the existing Lottie infrastructure where appropriate.

Addresses feedback from @emako in comments #3315237912 and #3315247932.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits September 20, 2025 17:09
Co-authored-by: emako <24737061+emako@users.noreply.github.com>
Co-authored-by: emako <24737061+emako@users.noreply.github.com>
Copilot AI changed the title [WIP] Telegram Sticker .tgs Add support for Telegram Sticker (.tgs) files Sep 20, 2025
Copilot AI requested a review from emako September 20, 2025 17:13
@emako
Copy link
Member

emako commented Sep 20, 2025

@copilot Create a new folder named Tgs in https://github.com/QL-Win/QuickLook/tree/master/QuickLook.Plugin/QuickLook.Plugin.ImageViewer/Webview instead of modifing the Lottie.

Co-authored-by: emako <24737061+emako@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Sep 20, 2025

@copilot Create a new folder named Tgs in https://github.com/QL-Win/QuickLook/tree/master/QuickLook.Plugin/QuickLook.Plugin.ImageViewer/Webview instead of modifing the Lottie.

I've refactored the implementation to create a separate Tgs folder as requested. The new structure includes:

  • QuickLook.Plugin.ImageViewer.Webview.Tgs namespace with dedicated TGS classes
  • TgsExtractor.cs, TgsDetector.cs, TgsMetaProvider.cs, and TgsImagePanel.cs
  • Reverted all modifications to the Lottie folder classes
  • Updated WebHandler.cs to use the TGS-specific classes for .tgs files

This maintains complete separation between TGS and Lottie functionality while still leveraging the existing infrastructure where appropriate. Changes implemented in commit 0b0e9e9.

@emako
Copy link
Member

emako commented Sep 20, 2025

@copilot remove your [QuickLook.Plugin/QuickLook.Plugin.ImageViewer/Webview/Lottie/TgsExtractor.cs](https://github.com/QL-Win/QuickLook/pull/1762/files#diff-badfcad9059accea6d372a533ab3d22dcf06a52771801888e9c50121f92e1b81) file

Co-authored-by: emako <24737061+emako@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Sep 20, 2025

@copilot remove your `[QuickLook.Plugin/QuickLook.Plugin.ImageViewer/Webview/Lottie/TgsExtractor.cs](https://github.com/QL-Win/QuickLook/pull/1762/files#diff-badfcad9059accea6d372a533ab3d22dcf06a5277...

Removed the duplicate TgsExtractor.cs file from the Lottie folder. The file was incorrectly left during the refactoring process. Now only the correct version exists in the dedicated Tgs folder with the proper namespace. Changes implemented in commit cafd241.

Renamed and split validation methods for Lottie and TGS files to improve clarity and code reuse. Added IsVaildContent for both detectors and updated WebHandler to use the new method names.
@emako emako marked this pull request as ready for review September 21, 2025 20:57
@emako emako merged commit ad95955 into master Sep 21, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants