AerialViews icon indicating copy to clipboard operation
AerialViews copied to clipboard

WebDAV support

Open TtuxX opened this issue 2 years ago • 17 comments

Describe the solution you'd like...

Hi there @theothernt ! :)

Thank you so much for your great app and for adding the option for external media, this is really awesome :)

I would love to have Webdav support on your app, as I am using Nextcloud, and accessing Webdav is much easier for me (and maybe provider-agnostic) than SMB.

Thank you very much in advance for your kind help.

Best regards

TtuxX avatar Oct 04 '22 14:10 TtuxX

That's a good idea!

I did look into using a Webdav library for Android, but it's not actively maintained, so it might take a while to get it working.

Plus, I'm going to be away for the next 2 or 3 months so development will be quite slow!

theothernt avatar Oct 05 '22 14:10 theothernt

Ah... thank you very much for your help and the transparency of this information ! I look forward to this feature but will patiently wait until you will have time to work on it :)

Thank you so much !

TtuxX avatar Oct 07 '22 10:10 TtuxX

Small update. It appears there is finally a library I can use - it's for Android and is actively developed.

I'll give you an update when I have something working.

theothernt avatar Jun 26 '24 20:06 theothernt

Awesome, thank you so much for this update and working on it ! <3 It will be very useful to display easily the media stored in my Nextcloud instance

TtuxX avatar Jun 27 '24 15:06 TtuxX

When entering the details for a WebDav connection, is it common to ask for a complete URL

eg. https://192.168.1.2:5003/videos/aerial

or do some apps ask for all the details separately...

HTTP/HTTPS IP/Hostname Port Path

I'm trying to figure out what would be easier (and less error prone) to enter on a TV with a d-pad.

theothernt avatar Jun 28 '24 13:06 theothernt

I'm going to go with my 2nd option - have a serious of inputs as I think it's less likely that people will make mistakes that way.

I might have a beta for you in a couple of days.

theothernt avatar Jun 28 '24 22:06 theothernt

Ok, here is (link removed)

WebDAV support should work but it's only had minimal testing, so let me know if you find any issues. Also, both photos and videos are supported.

theothernt avatar Jun 30 '24 16:06 theothernt

It works amazingly well for photos, thanks a lot!

It also works kinda for videos, but I cannot have more than like 5-7 seconds of loading, then it freeze and skips to the next video (server is on LAN with ethernet so bandwidth should not be the issue, and media actually play well for few seconds).

Apart from this, do you think the following could be feasible?

  • Have an option to make the folder search recursive and include all the following content? With like a pop-up displaying live the folders names that are being crawled during content indexing (that would be displayed from the connection test and until the end pop-up that summarise the media scan results)
  • Be able to browse host folders and select them with the remote instead of manually inputing the path? It would be so handy to select one (or even ideally multiple) folder(s) just with the TV stick! When digging deep in a path, having to type it becomes increasingly difficult

Thanks a lot again for your time and super work, I'm can now enjoy my Nextcloud media and that's so cool! :)

TtuxX avatar Jul 01 '24 19:07 TtuxX

It also works kinda for videos, but I cannot have more than like 5-7 seconds of loading, then it freeze and skips to the next video (server is on LAN with ethernet so bandwidth should not be the issue, and media actually play well for few seconds).

Ok, I'll look into this. Roughly, what is the file size and length of some of the videos?

Have an option to make the folder search recursive and include all the following content? With like a pop-up displaying live the folders names that are being crawled during content indexing (that would be displayed from the connection test and until the end pop-up that summarise the media scan results)

When I have playback working reliably, I will add a recursive option. But I'm not sure I can add any kind of progress to the file scanning. Unless you have 20k files, it should be able to get a file list in a few seconds.

Be able to browse host folders and select them with the remote instead of manually inputing the path? It would be so handy to select one (or even ideally multiple) folder(s) just with the TV stick! When digging deep in a path, having to type it becomes increasingly difficult

If I find another project that provides this, I will use it - but in the meantime, it's a bit too much work for me. My only advice to entering paths, and I have to do it a bit because of testing, is to use the phone app which makes text entry a bit faster.

theothernt avatar Jul 01 '24 20:07 theothernt

  • length of some of the videos: Around 35mb and 24 seconds

  • Files scanning speed: Awesome, I would not think that would go that fast! No reason for implementing this then indeed

  • Browsing: Okay, thank you a lot for this! Awesome if you can and if find something handy, otherwise I'll try to it with an app

TtuxX avatar Jul 01 '24 21:07 TtuxX

If you have some time, can you try the Nova Video Player - it uses a version of the library I'm using. I want to see if it plays video without issues.

Their fork/version of the library has some fixes, so I may use that.

theothernt avatar Jul 02 '24 13:07 theothernt

Here is (link removed)

I've updated the internal WebDAV library and added subfolder support.

theothernt avatar Jul 02 '24 15:07 theothernt

If you have some time, can you try the Nova Video Player - it uses a version of the library I'm using. I want to see if it plays video without issues.

Their fork/version of the library has some fixes, so I may use that.

I installed it and tried to connect it without success to Nextcloud, I have to try again and report back

TtuxX avatar Jul 03 '24 22:07 TtuxX

Here is (link removed).

I've updated the internal WebDAV library and added subfolder support.

I installed it, went few folders above the one I previously had selected and now have 296 media selected for playback instead of 58 previously. I selected only pictures in your app settings. However it seems like loading is hanging forever now, and I cannot have pictures start displaying.

I tried selecting again the subfolder I had and that worked on your previous version, and pictures do not load anymore

TtuxX avatar Jul 03 '24 22:07 TtuxX

Ok, here is (link removed) with a different version of the library. It's the same version that Nova Video Player uses.

If the issues continue, I'll have to make a debug build for you. You'll then have to use the ADB tools to collect the logs and send them to me.

Also, what device are you using?

EDIT: I've tested on the following with no issues (photos and videos)

  • Google TV, Android 12
  • Emulator, Android 9 and 12

theothernt avatar Jul 04 '24 13:07 theothernt

OK, I tried your version and the result is the same, but I guess I found a bit more information.

  1. authentication tokens are correct and working on my side (scan report works well)
  2. Folder path is working
  3. However, when app tries to load images, I see a lot of crawling happening quickly, and I get 2 successive messages in the Nginx access.log for each file: 192.168.1.1 - domain.com [08/Jul/2024:23:14:52 +0200] "GET /remote.php/dav/files/user/remote.php/dav/files/user/2023/20240224_185420059.jpg HTTP/2.0" 401 450 "-" "okhttp/4.12.0" "-"rt=0.037 ut=0.036 cs=- 192.168.1.1 - domain.com [08/Jul/2024:23:14:52 +0200] "GET /remote.php/dav/files/user/remote.php/dav/files/user/2023/20240224_185420059.jpg HTTP/2.0" 404 192 "-" "okhttp/4.12.0" "-"rt=0.130 ut=0.130 cs=-

Basically error 401, followed by error 404.

My device is Nvidia Shield 2019 on Android 11

First build was working fine but I deleted the file. I would have been curious to test it again see if it works and be sure nothing is wrong on my side.

EDIT: I think I kinda found the bug: it seems like somehow in your last versions you're appending too much of a variable or something when you are doing the path reconciliation between Hostname & port and Path name. In my case the path is partly duplicated, leading to an incorrect and non-existing location :)

TtuxX avatar Jul 08 '24 21:07 TtuxX

Here is an updated build. I've fixed the path handling so lets test that first.

Also, looking at the log above, your hostname + IP and path name should be set to...

  • 192.168.1.1:80
  • /remote.php/dav/files/user

theothernt avatar Jul 09 '24 13:07 theothernt