Skip to content

Automatically determine profile type + some typing#867

Draft
mayty wants to merge 3 commits into
sigma67:mainfrom
mayty:feature/861_get_channel_type
Draft

Automatically determine profile type + some typing#867
mayty wants to merge 3 commits into
sigma67:mainfrom
mayty:feature/861_get_channel_type

Conversation

@mayty

@mayty mayty commented Feb 1, 2026

Copy link
Copy Markdown

Fixes #861

@codecov

codecov Bot commented Feb 1, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.09524% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 95.53%. Comparing base (5578f89) to head (d39d4c1).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
ytmusicapi/mixins/profiles.py 97.40% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #867      +/-   ##
==========================================
+ Coverage   95.51%   95.53%   +0.02%     
==========================================
  Files          46       47       +1     
  Lines        2543     2600      +57     
==========================================
+ Hits         2429     2484      +55     
- Misses        114      116       +2     
Flag Coverage Δ
unittests 95.53% <98.09%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mayty
mayty force-pushed the feature/861_get_channel_type branch from 7c72c25 to 0651be7 Compare February 1, 2026 21:05
@mayty
mayty force-pushed the feature/861_get_channel_type branch from 0651be7 to d39d4c1 Compare February 1, 2026 21:13
@mayty

mayty commented Feb 1, 2026

Copy link
Copy Markdown
Author

@sigma67 I added a bit of typing in addition to determining profile type, so it's easier to work with the library on the consumer side. I couldn't propagate it further down the code (e.g., def parse_album(result: JsonDict) -> AlbumInfo:) without refactoring the current typing system because it starts conflicting with ParseFuncType, ParseFuncDictType, ... arg types

If you think that it's gonna introduce unnecessary maintenance overhead, I will roll back the typing addition

@mayty
mayty marked this pull request as ready for review February 1, 2026 22:01

@sigma67 sigma67 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @mayty , this PR is much too invasive. A 600 line diff is not warranted given your proposal in #861 .

Please reduce it to the minimum set of changes implementing a get_channel_type method.

assert determined_type == ProfileTypes.CHANNEL

def test_profile_type_not_ignored(self, yt):
with (

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please do not use mock.patch in tests

@sigma67
sigma67 marked this pull request as draft April 23, 2026 16:58
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.

Add get_channel_type method

2 participants