RSS-Bridge / rss-bridge

The RSS feed for websites missing it
https://rss-bridge.org/bridge01/
The Unlicense
6.99k stars 1.02k forks source link

Add M3U format #3998

Open boyska opened 3 months ago

boyska commented 3 months ago

fixes #3995

this is especially useful for podcasts.

dvikan commented 3 months ago

pls put all code inside a single class

boyska commented 3 months ago

pls put all code inside a single class

can I ask you what's the rationale for this? While I can see how moving parse_duration() inside a class can enhance encapsulation (did that in 2597cff5), I think that exploding M3uItem into a set of methods and private variables will result in code that is harder to read, understand and maintain.

But I'm not particularly good at PHP, so maybe you have suggestions for how to keep the code well encapsulated, while having the same benefit of "all code in a single class".

dvikan commented 3 months ago

php does not have modules like python does.

your previous function parse_duration was defined in global namespace.

also it's my subjective preference to have code closer together and not spread out.

i'd prefer you drop M3uItem and inline all code inside M3uFormat.

boyska commented 3 months ago

i'd prefer you drop M3uItem and inline all code inside M3uFormat.

like this? 266a6c01380b3feb0f89e63b5480d46bbffc681c

if you think this is still not right, just tell me: I'm eager to learn :)

boyska commented 3 months ago

gentle ping :)

dvikan commented 3 months ago

yes still thinking about this.