-
-
Notifications
You must be signed in to change notification settings - Fork 692
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
notifications - adds a test if a image-url source contains a GIF file #4326
Draft
BitWuehler
wants to merge
51
commits into
home-assistant:master
Choose a base branch
from
BitWuehler:GIF-Test
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 7 commits
Commits
Show all changes
51 commits
Select commit
Hold shift + click to select a range
87db73a
Update MessagingManager.kt
BitWuehler 37e4af5
changed Logger and connection library
BitWuehler c45f611
Update MessagingManager.kt
BitWuehler 0623b93
Merge branch 'master' into GIF-Test
BitWuehler 526a526
import BuildConfig
BitWuehler fe87bd1
Merge branch 'GIF-Test' of https://github.com/BitWuehler/android into…
BitWuehler b41186b
change UserAgent | variable import
BitWuehler 28af403
change requestmethod to head
BitWuehler e3399fc
Switch to HttpURLConnection for http connection
BitWuehler 0492041
adds an byte checkup for GIFs in Entity-URLs
BitWuehler 9fd1b39
lil fix
BitWuehler 3849bb8
delete blankline
BitWuehler ccfa110
adds also checkup for camer enitities
BitWuehler 5f5f5be
correct the GIF-ByteArray recognition
BitWuehler c6af9bc
Merge branch 'master' into GIF-Test
BitWuehler 6899201
add the requiresAuth Parameter
BitWuehler 2c2fe52
remove blankline
BitWuehler f351309
add url logging for further debugging
BitWuehler 41af87d
switching to okhttpclient and remove bytecheck
BitWuehler e9f09e4
removed spaces
BitWuehler 36b63e8
again
BitWuehler 98a64ee
correct code
BitWuehler 6a3bdf9
more fixes
BitWuehler 3f0ae5a
fix
BitWuehler 654a1b3
fix
BitWuehler 84ca69f
fix
BitWuehler b4edd05
fix
BitWuehler e0c2871
fix
BitWuehler 27949fc
fix
BitWuehler 0bbf8f0
correction
BitWuehler bc06686
remove }
BitWuehler 569fb19
fcn fix
BitWuehler 4812dcd
fk the spaces
BitWuehler 26f189d
change things
BitWuehler 3b5a731
switch back to HttpURLConnection
BitWuehler fc4dc27
correction
BitWuehler 4f378e8
fix
BitWuehler f59cf1e
more logging for debugging
BitWuehler 6742d43
more dugging and auth token changes
BitWuehler 7a6706d
use get if head request is not allowed
BitWuehler afa23b4
change Authorisation again
BitWuehler 7a4b601
Merge branch 'master' into GIF-Test
BitWuehler 78fa00c
change auth
BitWuehler a5577fc
fix
BitWuehler c94b89e
fix
BitWuehler 60cc698
fix
BitWuehler 30c46bb
fix
BitWuehler 6f51cc5
head method fix
BitWuehler e5675f9
better logging
BitWuehler 90008b6
fix
BitWuehler 61f0d9f
del blanks
BitWuehler File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
It looks like this results in the entire image (or whatever is behind the URL) being downloaded. As the image is also fetched later, that is work that should be avoided as it duplicates data used. Try only getting the headers which should contain the content type. This also doesn't handle the authentication required images (hosted on the HA server).
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.
You are right. I commit a "connection.requestMethod = "HEAD" for that.
But what du you mean with "authentication required images (hosted on the HA server)"? I only know direct image paths but these ones should be handled with the filename ending.
Do you maybe mean the use of Image entities? For that this really does not work. But i'm not shure how to resolve this problem. Maybe we could check the file header here?
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.
I now added a byte checkup for the Entity urls. Im not sure if this works good like this, but i will check it with the generated apk!
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.
Because I dont have a image entitiy and i dont now how to add one manually i can't test the byte GIF-check with the image entity. I tryed it with the camera entity, because i used a gif in my camera entity but that doesn't work. Do you now, if the camera entity converts the input somehow? If yes i will delete the camera gif-check.