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

AList v3 Doesn't Seem to Recognize File Type #1710

Closed
4 tasks done
DarremMolko opened this issue Sep 18, 2022 · 9 comments
Closed
4 tasks done

AList v3 Doesn't Seem to Recognize File Type #1710

DarremMolko opened this issue Sep 18, 2022 · 9 comments
Labels
bug Something isn't working question Further information is requested

Comments

@DarremMolko
Copy link

Please make sure of the following things

  • I have read the documentation.
  • I'm sure there are no duplicate issues or discussions.
  • I'm sure it's due to alist and not something else(such as Dependencies or Operational).
  • I'm sure I'm using the latest version

Alist Version / Alist 版本

v3.0.0-rc.1

Driver used / 使用的存储驱动

Google Drive, OneDrive

Describe the bug / 问题描述

AList v3 doesn't seem to recognize file type.

Reproduction / 复现链接

  1. Mount AList with DAVx⁵ (https://github.com/bitfireAT/davx5-ose) as Documents Provider
  2. Access the mounted AList with the android native Files app
  3. Notice that video files are not recognized, instead it shows the type of file as BIN

Screenshot of AList v2.6.4, working as expected
Screenshot_20220918-111820

Screenshot of AList v3
Screenshot_20220918-111801

Logs / 日志

No relevant logs available.
@DarremMolko DarremMolko added the bug Something isn't working label Sep 18, 2022
@welcome
Copy link

welcome bot commented Sep 18, 2022

Thanks for opening your first issue here! Be sure to follow the issue template!

@xhofe
Copy link
Collaborator

xhofe commented Sep 19, 2022

unable to reproduce
image
The mimetype of the file returned by alist is correct in my test.

@xhofe xhofe added the question Further information is requested label Sep 19, 2022
@github-actions
Copy link

Hello @DarremMolko, please input issue by template and add detail. Issues labeled by question will be closed if no activities in 7 days.
你好 @DarremMolko,请按照issue模板填写, 并详细说明问题/复现步骤/复现链接/实现思路或提供更多信息等, 7天内未回复issue自动关闭。

@DarremMolko
Copy link
Author

This happens with Google Drive and OneDrive, not a local video. If I intercept the intent this is what I get:

USING ALIST VERSION v2.6.4

URI	intent://at.bitfire.davdroid.webdav/document/359#Intent;scheme=content;type=video/mp4;launchFlags=0x3000003;end

VERSION	1
ACTION	android.intent.action.VIEW
DATA	content://at.bitfire.davdroid.webdav/document/359
TYPE	video/mp4
FLAGS	0x3000003

USING ALIST v3.0.0-rc.1

URI	intent://at.bitfire.davdroid.webdav/document/190#Intent;scheme=content;type=application/octet-stream;launchFlags=0x3000003;end

VERSION	1
ACTION	android.intent.action.VIEW
DATA	content://at.bitfire.davdroid.webdav/document/190
TYPE	application/octet-stream
FLAGS	0x3000003

@xhofe
Copy link
Collaborator

xhofe commented Sep 19, 2022

The mimetype is identified by file extension, which should be independent of storage provider.
Onedrive:
image

@DarremMolko
Copy link
Author

Oh, then I'm not really sure what is happening. If I use propget using cadaver (command line WebDAV client) in a video file I still can't get the correct content type:

dav:/dav/drive/Movies/> propget Zeros.and.Ones.2021.mkv
Fetching properties for `Zeros.and.Ones.2021.mkv':
DAV: displayname = Zeros.and.Ones.2021.mkv
DAV: getcontenttype = application/octet-stream
DAV: getlastmodified = Mon, 01 Jan 0001 00:00:00 GMT
DAV: getcontentlength = 1764976284

This example is using Google Drive.

@xhofe
Copy link
Collaborator

xhofe commented Sep 19, 2022

The only difference between v2 and v3 is:

  • v2: the mimetype for all files are empty
  • v3: try get mimetype by file extension and set application/octet-stream as default if can't get.

In addition, the result of getting mimetype by file extension is usually system related.

I will close this issue after set empty as default instead of application/octet-stream, maybe this is the correct behavior.

@xhofe xhofe closed this as completed in ca177cc Sep 19, 2022
@xhofe
Copy link
Collaborator

xhofe commented Sep 19, 2022

@DarremMolko
Copy link
Author

Indeed, that was it, now it's showing the correct content type. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants