Closed dineiar closed 2 years ago
@dineiar I have tried fixing it. Can you try and give feedback and also parse_m3u method will take trim=True/False so by default trim is False but if you pass trim=True while generating json the empty values will be removed. I have kept this so that we can get desired output. And saving to m3u only saves info present on the original m3u file only.
@pawanpaudel93, it looks great. I made some tests and it seems to be working great. I made some comments on your commit to some points that I think could be improved.
I've also renamed the trim
parameter that you created to enforce_schema
in PR #13. Merge it if you agree with me.
Also, I believe that the default value for this parameter should be False
(ignoring non-existing fields by default), because that is what I would expect a library to do (keep the processed file as close as possible to the original), but I kept it True
according to your implementation of the trim
parameter.
When the name of the entry in the M3U contains a comma,
M3uParser
only gets the last part of the name. Sample M3U:Using
parse_m3u
andto_file('json')
outputs:The "name" field should be
Doe, John
, but it is onlyJohn
.Also,
to_file('m3u')
outputs:The issue is the parsing of the title, which I'm still not entirely sure how to fix.