Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Renaming trim to enforce_schema in parse_m3u #13

Merged
merged 4 commits into from
Jul 26, 2021

Conversation

dineiar
Copy link
Contributor

@dineiar dineiar commented Jul 22, 2021

No description provided.

line += ' tvg-language="{}"'.format(stream_info["language"]["name"])
if stream_info.get("category"):
if "language" in stream_info:
line += ' tvg-language="{}"'.format(stream_info["language"]["code"])
Copy link
Owner

@pawanpaudel93 pawanpaudel93 Jul 23, 2021

Choose a reason for hiding this comment

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

@dineiar Here I had kept the name and you replaced it with the code again ?? Any reason to do so ?? I followed the m3u files present here https://github.com/iptv-org/iptv/tree/master/channels.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It was a mistake, sorry @pawanpaudel93. It should be fixed now (f34cd0d).

@pawanpaudel93
Copy link
Owner

@dineiar If enforce_schema is set to True then for non-exising fields it will have None and if we save it to JSON it's fine but when we save it to m3u then it has "None" text for the non-existing fields. It's okay to have "None" in m3u ??

@dineiar
Copy link
Contributor Author

dineiar commented Jul 25, 2021

@pawanpaudel93, this is a side-effect of using stream_info.get that I mentioned in you commit (4a414ad).

In this PR I fixed it by using "key" in stream_info instead of stream_info.get("key", {}) around line 450 or m3u_parser.py, so it ignores the non-existing fields and doesn't fill "None".

@pawanpaudel93
Copy link
Owner

pawanpaudel93 commented Jul 26, 2021

@dineiar Are you sure about what you are talking if it doesn't fill None when saving to m3u file with enforce_schema=True with "key" in stream_info ??

@dineiar
Copy link
Contributor Author

dineiar commented Jul 26, 2021

@pawanpaudel93, oh, I'm sorry, I was talking about using enforce_schema=False. I did not pay enough attention to your last comment.

I just fixed that issue in 319a918.

@pawanpaudel93 pawanpaudel93 merged commit babc496 into pawanpaudel93:master Jul 26, 2021
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