Closed ghost closed 7 years ago
That looks fine on first glance. I will have to test it before merging and I need a bit of time for that.
I looked at this a bit more closely and I think it's done a bit to generic. The "case 0" one would still make sense even without any files as it is just a link to the detailpage. So that check should go into each case, and likely as well be done for the title link.
On a sidenote I saw that the "Control Player" is quite broken when there are sermons without any files as it will select the wrong entry in the playlist. I need to check that as well.
I guess you're right. This solution was more like a quick fix.
Regarding the playlist selection, I have a commit in my repo to work around this in the JWPlayer plugin, but it is definitely not ready for general use: https://github.com/fri-sch/SermonSpeaker/commit/2723fee129fa6dc435bb8f9b431a5fe578d556e9
I'm going to merge this and adjust as needed afterwards.
Btw: https://github.com/Bakual/SermonSpeaker/commit/90e7e068c72a72f76cad413a50ceb673e478f00b should fix the issue with the playlist selection. Apparently JW Player just ignores a pic now for the playlist, that used to work in earlier versions. I now just use a blank.mp3 file instead of the picture to create a dummy playlist entry.
https://github.com/Bakual/SermonSpeaker/commit/40333f30432dd72f11e97082abbe8b861b9fb9fd should fix the remaining issues. Thanks!
Another small change to prevent users from trying to play a sermon if there's no audio or video attached. In my opinion it's best to not show the play icon at all.