mirror of
https://github.com/rclone/rclone.git
synced 2025-11-23 21:44:49 +02:00
fs: allow Metadata calls to be called with Directory or Object
This involved adding the Fs() method to DirEntry as it is needed in the metadata mapper. Unspecialised fs.Dir objects will return a new fs.Unknown from their Fs() methods as they are not specific to any given Fs.
This commit is contained in:
@@ -54,7 +54,7 @@ func MimeTypeFromName(remote string) (mimeType string) {
|
||||
|
||||
// MimeType returns the MimeType from the object, either by calling
|
||||
// the MimeTyper interface or using MimeTypeFromName
|
||||
func MimeType(ctx context.Context, o ObjectInfo) (mimeType string) {
|
||||
func MimeType(ctx context.Context, o DirEntry) (mimeType string) {
|
||||
// Read the MimeType from the optional interface if available
|
||||
if do, ok := o.(MimeTyper); ok {
|
||||
mimeType = do.MimeType(ctx)
|
||||
|
||||
Reference in New Issue
Block a user