[PR #56] [MERGED] Refact/titles #122

Closed
opened 2026-03-04 00:03:58 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/YouG-o/YouTube-No-Translation/pull/56
Author: @YouG-o
Created: 7/5/2025
Status: Merged
Merged: 7/5/2025
Merged by: @YouG-o

Base: mainHead: refact/titles


📝 Commits (9)

  • d343f84 refactor: extract video ID parsing logic to util function extractVideoIdFromUrl
  • e420397 refactor: extract browsing title element validation logic to shouldProcessBrowsingElement.
  • e62a7c0 refactor: extract browsing title element state check logic to checkElementProcessingState
  • b5611c2 refactor: extract original title fetching logic to fetchOriginalTitle function
  • 707a0d3 refactor: use extractVideoIdFromUrl utility in shorts titles processing
  • d9356b7 refactor: use fetchOriginalTitle for notification popup titles
  • 5a39148 refactor: extract and use fetchMainTitle for main, embed, and miniplayer title retrieval
  • 9910aa8 refactor: use extractVideoIdFromUrl utility in notification title processing
  • b26d99a refactor: unify shorts title retrieval logic using fetchMainTitle and fetchOriginalTitle

📊 Changes

7 files changed (+423 additions, -438 deletions)

View changed files

📝 CHANGELOG.md (+11 -0)
📝 src/content/titles/browsingTitles.ts (+265 -236)
📝 src/content/titles/mainTitle.ts (+72 -106)
📝 src/content/titles/notificationTitles.ts (+9 -44)
📝 src/content/titles/shortsTitles.ts (+15 -52)
src/content/utils/video.ts (+31 -0)
📝 src/types/types.ts (+20 -0)

📄 Description

Refactor YouTube title retrieval logic
This PR centralizes and unifies all logic related to YouTube title extraction and restoration.
Common code is now shared across browsing, shorts, notifications, and main video titles, making the codebase much easier to maintain and test.

All features have been tested in real conditions and work as expected.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/YouG-o/YouTube-No-Translation/pull/56 **Author:** [@YouG-o](https://github.com/YouG-o) **Created:** 7/5/2025 **Status:** ✅ Merged **Merged:** 7/5/2025 **Merged by:** [@YouG-o](https://github.com/YouG-o) **Base:** `main` ← **Head:** `refact/titles` --- ### 📝 Commits (9) - [`d343f84`](https://github.com/YouG-o/YouTube-No-Translation/commit/d343f841fad5fc62cc267d9c7c1703d6c34df56e) refactor: extract video ID parsing logic to util function extractVideoIdFromUrl - [`e420397`](https://github.com/YouG-o/YouTube-No-Translation/commit/e420397a0c42d376473b99526342fa46c22b21f6) refactor: extract browsing title element validation logic to shouldProcessBrowsingElement. - [`e62a7c0`](https://github.com/YouG-o/YouTube-No-Translation/commit/e62a7c05c15aed0f3c9147b0658581b104e3cce9) refactor: extract browsing title element state check logic to checkElementProcessingState - [`b5611c2`](https://github.com/YouG-o/YouTube-No-Translation/commit/b5611c2eac2e62f1083f594cdd3ffc6e9552353e) refactor: extract original title fetching logic to fetchOriginalTitle function - [`707a0d3`](https://github.com/YouG-o/YouTube-No-Translation/commit/707a0d3a9d7feed4eccc0a04b1de8e969f13d9cc) refactor: use extractVideoIdFromUrl utility in shorts titles processing - [`d9356b7`](https://github.com/YouG-o/YouTube-No-Translation/commit/d9356b7a51b2c3af000f541afcaf898b1eed4443) refactor: use fetchOriginalTitle for notification popup titles - [`5a39148`](https://github.com/YouG-o/YouTube-No-Translation/commit/5a39148292ece828d7227eb12b58ce0ce2071c2b) refactor: extract and use fetchMainTitle for main, embed, and miniplayer title retrieval - [`9910aa8`](https://github.com/YouG-o/YouTube-No-Translation/commit/9910aa80d6226cd194e7f9ff953bc1a9147fc904) refactor: use extractVideoIdFromUrl utility in notification title processing - [`b26d99a`](https://github.com/YouG-o/YouTube-No-Translation/commit/b26d99a7129d71bcc77124f0cb015218ebda9907) refactor: unify shorts title retrieval logic using fetchMainTitle and fetchOriginalTitle ### 📊 Changes **7 files changed** (+423 additions, -438 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+11 -0) 📝 `src/content/titles/browsingTitles.ts` (+265 -236) 📝 `src/content/titles/mainTitle.ts` (+72 -106) 📝 `src/content/titles/notificationTitles.ts` (+9 -44) 📝 `src/content/titles/shortsTitles.ts` (+15 -52) ➕ `src/content/utils/video.ts` (+31 -0) 📝 `src/types/types.ts` (+20 -0) </details> ### 📄 Description Refactor YouTube title retrieval logic This PR centralizes and unifies all logic related to YouTube title extraction and restoration. Common code is now shared across browsing, shorts, notifications, and main video titles, making the codebase much easier to maintain and test. All features have been tested in real conditions and work as expected. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-04 00:03:58 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/YouTube-No-Translation#122
No description provided.