Skip to content
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

Bad way to determine if a media source prefix is needed #4

Open
gerbenvandekraats opened this issue Apr 24, 2023 · 0 comments
Open

Comments

@gerbenvandekraats
Copy link

gerbenvandekraats commented Apr 24, 2023

I was getting a new type of slide ready and i found that my input fields were getting prefixed with the media source url. In this case i created a few custom fields to enter some YouTube ID's. I called those fields 'video1', 'video2' and 'video3'. I entered just the YouTube ID but they came out of the export.json as '/uploads/dQw4w9WgXcQ'.

After a bit of searching i found out that if the field key contains 'video', 'logo' or 'image' the value will be prefixed with the Media Source URL by this bit of code:

if (stripos($subKey, 'image') !== false || stripos($subKey, 'logo') !== false) {

The better way seems to check the actual field type of the slide type to determine if the prefix need to be added.

So i just creating this issue like a todo. Maybe I will give it a go... but if somebody feels the urge, feel free 😉

@gerbenvandekraats gerbenvandekraats changed the title bad way to determine if a media source prefix is needed Bad way to determine if a media source prefix is needed Apr 24, 2023
gerbenvandekraats added a commit to gerbenvandekraats/digitalsignage that referenced this issue Apr 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant