mirror of
https://github.com/arichornlover/uYouEnhanced.git
synced 2026-04-21 11:52:00 +00:00
Avoid adding multiple times
This commit is contained in:
parent
4a02d265eb
commit
55cfde9391
1 changed files with 4 additions and 1 deletions
|
|
@ -322,6 +322,7 @@ BOOL isAd(YTIElementRenderer *self) {
|
||||||
* and adds a "Downloads" cell below the "Your videos" cell
|
* and adds a "Downloads" cell below the "Your videos" cell
|
||||||
* @param model The model for the You tab
|
* @param model The model for the You tab
|
||||||
* TODO Add localization support for the Get Youtube Premium and Downloads text
|
* TODO Add localization support for the Get Youtube Premium and Downloads text
|
||||||
|
* TODO Combine with the Fake Youtube Premium logo
|
||||||
*/
|
*/
|
||||||
%new
|
%new
|
||||||
- (void)uYouEnhancedFakePremiumModel:(YTISectionListRenderer *)model {
|
- (void)uYouEnhancedFakePremiumModel:(YTISectionListRenderer *)model {
|
||||||
|
|
@ -368,7 +369,7 @@ BOOL isAd(YTIElementRenderer *self) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (yourVideosCellIndex != -1) {
|
if (yourVideosCellIndex != -1 && subContentsArray[yourVideosCellIndex].accessibilityLabel == nil) {
|
||||||
// Create the fake Downloads page by copying the Your Videos page and modifying it
|
// Create the fake Downloads page by copying the Your Videos page and modifying it
|
||||||
// Note that this must be done outside the loop to avoid a runtime exception
|
// Note that this must be done outside the loop to avoid a runtime exception
|
||||||
// TODO Link this to the uYou downloads page
|
// TODO Link this to the uYou downloads page
|
||||||
|
|
@ -377,6 +378,8 @@ BOOL isAd(YTIElementRenderer *self) {
|
||||||
newItemSectionSupportedRenderers.compactListItemRenderer.thumbnail.iconThumbnailRenderer.icon.iconType = 147;
|
newItemSectionSupportedRenderers.compactListItemRenderer.thumbnail.iconThumbnailRenderer.icon.iconType = 147;
|
||||||
// Insert this cell after the Your Videos cell
|
// Insert this cell after the Your Videos cell
|
||||||
[subContentsArray insertObject:newItemSectionSupportedRenderers atIndex:yourVideosCellIndex + 1];
|
[subContentsArray insertObject:newItemSectionSupportedRenderers atIndex:yourVideosCellIndex + 1];
|
||||||
|
// Inject a note to not modify this again
|
||||||
|
subContentsArray[yourVideosCellIndex].accessibilityLabel = @"uYouEnhanced Modified";
|
||||||
yourVideosCellIndex = -1;
|
yourVideosCellIndex = -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue