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
Allow custom poster images #103
Conversation
Could be for audio or video
It will override the custom one chosen
This will make it easier to let JS manipulate
|
||
$mediahub = new UNL_MediaHub($dsn); | ||
|
||
$list = new UNL_MediaHub_MediaList(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of iterating over the entire table of media, it would be better to have a filtered list of only media with a poster.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed in mfairchild365@23ccadc
@kabel ready for another review |
} | ||
|
||
foreach ($http_response_header as $header) { | ||
if (strpos($header, 'HTTP/1.1 404 Not Found') !== false) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The status header will always be the first in the array (no need to check the others). Also, not all servers will respond with HTTP/1.1
. Also, servers will not always use the string Not Found
. Only the response code is guaranteed by the protocol.
404 is also not the only problematic response.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very true. I was just copy/pasting the find404Media script. Both could use an update.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think it would be better to look for 200
instead of HTTP/1.1 404 Not Found
. If its not 200
remove it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. That would be better and can be easily parse by exploding the first header on whitespace.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed in mfairchild365@bd1eade
The status header will always be the first in the array (no need to check the others). Also, not all servers will respond with HTTP/1.1. Also, servers will not always use the string Not Found. Only the response code is guaranteed by the protocol. 404 is also not the only problematic response.
@kabel ready for another review |
Allow custom poster images
This adds a poster field to the media table that will override the default iTunesU poster image.