kodi-pvr / pvr.iptvsimple

IPTV Simple client for Kodi PVR
GNU General Public License v2.0
782 stars 373 forks source link

Feature request: Support for multiple playlists #41

Closed AndreyPavlenko closed 8 years ago

AndreyPavlenko commented 9 years ago

I have this feature implemented on top of an old version of this addon - https://github.com/AndreyPavlenko/xbmc-addon-iptvsimple/commit/45841de468645c7aa796ab76016699f2317259c4 , but it's quite difficult for me to merge it into this addon.

Can we have this feature implemented in this addon?

bam80 commented 4 years ago

Why closed? It seems still actual, as well as multiple EPG sources

phunkyfish commented 4 years ago

It’s a 4 year old issue closed by the opener a few months later.

Please try iptvmerge if you need this functionality.

bam80 commented 4 years ago

Thanks for reply. About iptvmerge, I know it, but the need of separate addon for this seems questionable to me, since Kodi actually already has required functionality internally. What I mean: I tried manually concatenate multiple xmltv files (of course a few changes needed to make it valid xml in the end), and Kodi perfectly parsed the resulted output. So it seems logical if Iptvsimple addon would just allow adding multiple EPGs..

phunkyfish commented 4 years ago

It’s actually quite a complex problem. Handling caching, validity checks, conflicts etc. The addon itself has no ability to write xml. It only reads it which is why I recommend iptvmerge which is the use case it solves for.

bam80 commented 4 years ago

I understand it can be a complex problem in a whole, but Kodi handles XML concatenation perfectly for me (it seems just overrides programs with latest data), so maybe it's worth to expose that basic in-built functionality in Iptvsimple also, if possible.

phunkyfish commented 4 years ago

Yes, it’s the addon that parses the result and that piece will work. But adding multiple XMLTVs brings complexity in many ways, even for configuring in the GUI.

Have a look at this issue: https://github.com/kodi-pvr/pvr.iptvsimple/issues/307

If support get’s added to iptvmerge for referenced M3U’s it may be a better solution overall.

bam80 commented 4 years ago

@phunkyfish sorry I didn't catch what complexities you mean

Evandro1975 commented 4 years ago

It's unusefull to merge multiple playlists, too many channels are unmanageable especially when are thousands on Android devices. Also merge multiple EPG is unusefull because the possibility to has conflicts on the same event of the same channel is hi. In Italy we have an EPG provider (epg-guide) that produce dedicate EPG for a playlists and is the best way to have a smaller EPG file and the best EPG, but it's only for Italy.

bam80 commented 4 years ago

@Evandro1975 that conflicts are no problem for kodi since it handles them in a basic way which is appropriate for the most cases. See above

phunkyfish commented 4 years ago

Only the conflicts you found don’t cause an issue so far. There will be many others and those users need to be supported too.

I’m not saying this can’t be done it’s that to do it right in a maintainable way will be a lot of effort. I’m not sure that effort is time well spent where there are many tools, iptvmerge, webgrab++ etc. specifically designed for this purpose.

bam80 commented 4 years ago

Well, what I'm asking for is not doing something extra in a "right way". Just support what is already exists "as is".

PS: For the extended functionality, we could use additional addons..

phunkyfish commented 4 years ago

Can you define “as is”?

Anything beyond supporting one M3U file and one XMLTV file I would consider extended functionality.

bam80 commented 4 years ago

it means just do the dumb XMLs concatenation as I wrote earlier. The result of that concatenation would be handled by Kodi "as is".

PS: or just feed the XMLs to Kodi sequentially. I'm not aware of the implementation details..

phunkyfish commented 4 years ago

For you it may work. But for others it won’t, and that support overhead is not something I have the time to take on. In the future, it’s possible that a feature could be added to accomplish what you want but for right now you can use iptvmerge or webgrab++. Both can be automated so there is no intervention on your part.

bam80 commented 4 years ago

Hope it will be added and require no extra time in support. Since in this form it is supposed to support only in-build Kodi abilities to parse that "combined" XML, it is no much hassle if it won't work for someone. All of that might be corresponded to Kodi but not to addon itself.

phunkyfish commented 4 years ago

All that functionality is the addon and not kodi.

bam80 commented 4 years ago

Kodi definitely has some in-built functionality I meant, since it handles concatenated XML properly. At least for some cases.

PS: or you mean it's in iptvsimple addon and not in kodi actually? That is what I'm not aware..

bam80 commented 4 years ago

Even then, it seems more logical to have UI interface to that functionality iptvsimple already have, in the addon itself.

phunkyfish commented 4 years ago

It’s in IPTV simple not kodi. There is no ability in the addon to read multiple xml files currently. Yes, if you fashion you own combined XML file and validate it yourself it can read that file but it only supports a single file.

Please use a tool that is designed to aggregate XMLTV data to perform this function. This pvr addon is not the right place to add this functionality.

bam80 commented 4 years ago

Please use a tool that is designed to aggregate XMLTV data

I'm not sure iptvmerge is a proper addon either. It creates combined XML output which is not actually what I want. What I want is to read them one by one directly to Kodi's database, in a way how it's done in iptvsimple addon. That is why I think this addon is a more proper place to add it.

So how I can see it there is two possibility to implement it in a "proper" way:

PS: not sure if it possible since that EPG database maybe a personal iptvsimple data. Don't know. In that case, only one way remains :)

phunkyfish commented 4 years ago

The data can only be added to the PVR database by the iptv simple pvr addon.

If iptvmerge aggregates the data into a single file and iptvsimple simple adds it how does this not accomplish what you want?

You have stated it must only be via a new addon or the current one but a working solution presented to you is not acceptable.

You need to explain why the presented solution does not work for your use case.

Sorien commented 4 years ago

@bam80 how do you like to solve situation when 2 different m3u playlistes contains same channel which url you want to prefer? one streams may have different quality other one better connection and so on you have to create whole interface just to properly manage channels, similar for epg what if you have two different epg entries for same channel but one contains more data and second one has better cover image ...

bam80 commented 4 years ago

You need to explain why the presented solution does not work for your use case.

It is acceptable and it also works, I tried it too. It's just not very well suited to me since I generate my XMLs in external (not Kodi) script which has no access to iptvmerge functionality (and vice versa). So for my case it is better to handle the XMLs merging in my side also (but it was really tricky since there is no appropriate programs in LibreELEC for that). But only if iptvsimple could handle multiple XMLs it would fulfill my needs entirely..

bam80 commented 4 years ago

@Sorien please see above, the way iptvsimple handles it currently suits for me

phunkyfish commented 4 years ago

It is acceptable and it also works, I tried it too. It's just not very well suited to me since I generate my XMLs in external (not Kodi) script which has no access to iptvmerge functionality (and vice versa). So for my case it is better to handle the XMLs merging in my side also (but it was really tricky since there is no appropriate programs in LibreELEC for that). But only if iptvsimple could handle multiple XMLs it would fulfill my needs entirely..

I don’t see how iptvsimple could handle this correctly but iptvmerge could not, both are kodi based solutions and you couldn’t access either addons functionality externally from your script.

So the answer to my question of why this functionality needs to be in iptvsimple still needs explaining.

bam80 commented 4 years ago

iptvmerge is a separate addon and just another chunk with it's own overhead, etc. I don't actually need it's functionality. Maybe if I had it's supported remote EPG sources then it would be useful. What is actually needed is UI interface to existing iptvsimple abilities which is hidden right now.

So I can live with it but still think it's unreasonable drawback of iptvsimple.

bam80 commented 4 years ago

Maybe just explain current behavior iptvsimple has when it feeded with concatenated XML (it would be useful anyway), that would be supported behavior with multiple XMLs. Other than that will go to external facilities, so no extra support burden.

phunkyfish commented 4 years ago

There are no existing abilities in the addon for multiple files nor is there any hidden UI.

If you would like to understand the part if the addon that reads the file the function that loads the XMLTV is here: https://github.com/kodi-pvr/pvr.iptvsimple/blob/1df685ca521b8ddb7e93c3261bc106c8ebdc1529/src/iptvsimple/Epg.cpp#L61

PVR addons are binary addons so are written in c++ and not python.

bam80 commented 4 years ago

Thanks. I was talking about ability to handle data from multiple files, which can't be used now without concatenation the files beforehand, so its "hidden". I meant the behavior of that ability should probably be documented for users, because it's not obvious it can be used such way.

bam80 commented 4 years ago

The data can only be added to the PVR database by the iptv simple pvr addon.

By the way, why is that? Is it some Kodi restriction? I think the ability to add data to the database for others addons would be useful.

phunkyfish commented 4 years ago

Thanks. I was talking about ability to handle data from multiple files, which can't be used now without concatenation the files beforehand, so its "hidden". I meant the behavior of that ability should probably be documented for users, because it's not obvious it can be used such way.

Sorry this makes zero sense. Just because you were able to join some files together it does not mean the addon has the ability to handle multiple files. It can still only handle a single valid XML file. Full stop.

phunkyfish commented 4 years ago

The data can only be added to the PVR database by the iptv simple pvr addon.

By the way, why is that? Is it some Kodi restriction? I think the ability to add data to the database for others addons would be useful.

It is the contract between the PVR addons and Kodi. They manage the data sent to kodi and maintain it. There is no way for an addon to access data already in kodi, nor should there be. This will never change.

bam80 commented 4 years ago

I suppose EPG database format is common for all PVR addons. If so, it would be useful for some addons to supply the EPG to others. E.g, iptvmerge could provide EPG to any PVR addon and not only to iptvsimple or other one that can handle XMLTV.

phunkyfish commented 4 years ago

This will never be possible. It would break the contract between the PVR addon and kodi.

bam80 commented 4 years ago

Is it documented somewhere? I don't understand logic behind that since it seems useful feature. And every PVR addon now which wants just to import XMLTV would have to re-implement it itself..

phunkyfish commented 4 years ago

The code is the documentation. The readme file on the repo explains everything a user should need to know.

It’s true that every PVR addon that wants to import XMLTV would need to implement it. If someone has the time to implement that functionality in a library for PVR that would be an option but it would still only ever work for a PVR addon, and only for that PVR addons data.

bam80 commented 4 years ago

Well, I see we are in no way came to any consensus here, but thank you anyway for a long conversation :) I just wish to the project all the best.

bam80 commented 4 years ago

The data can only be added to the PVR database by the iptv simple pvr addon.

Just saw sEPGScraper field in channels table. What is it for? Does it mean the EPG data can still be added to the database by another addon?

phunkyfish commented 4 years ago

I don’t know.