Ape / mediainfo.yazi

Yazi plugin for previewing media files
MIT License
9 stars 1 forks source link

Deprecated API warning due to upstream changes #3

Open xfzv opened 2 weeks ago

xfzv commented 2 weeks ago

After updating yazi to https://github.com/sxyazi/yazi/commit/2014aee646a3ca28c56ff75c7c162fe5b6f11543, the following API deprecation message is printed when hovering some files (see below for details):

https://github.com/sxyazi/yazi/pull/1761/commits/8b47ebf2cecbe7157f03ed1b66f65e9ef52d12d0#diff-f3fd609a7d5e2151bea826946cc2bf959f788ad4b6b97175f4fcc2f81e2032feR10-R25

image

Edit: updated screenshot showcasing plug-in name after updating to https://github.com/sxyazi/yazi/commit/da1b2365b996dc919014467ec572ffe362af089e

ref: https://github.com/sxyazi/yazi/pull/1761


I can reproduce with this minimal setup:

% uname -s
Linux

% yazi -V
Yazi 0.3.3 (2014aee 2024-10-11)
% tree ~/.config/yazi
yazi
├── plugins
│   └── mediainfo.yazi
│       └── init.lua
└── yazi.toml

yazi.toml content:

[plugin]
fetchers = [
  { id = "mime", name = "*", run = "mime", if = "!mime", prio = "high" },
]

prepend_previewers = [
  { mime = "{image,audio,video}/*", run = "mediainfo" },
  { mime = "application/{octet-stream,x-subrip}", run = "mediainfo" },
]

Then, open yazi and hover some files. I could only trigger the warning when hovering images, audio and video files as well as ~/.Xauthority for example. Hovering directories and other files doesn't trigger the warning.

Either commenting these lines or mv ~/.config/yazi/plugins/mediainfo.yazi ~/.config/yazi/plugins/mediainfo.yazi.bak removes the warning:

- prepend_previewers = [
-   { mime = "{image,audio,video}/*", run = "mediainfo" },
-   { mime = "application/{octet-stream,x-subrip}", run = "mediainfo" },
- ]

+ # prepend_previewers = [
+ #   { mime = "{image,audio,video}/*", run = "mediainfo" },
+ #   { mime = "application/{octet-stream,x-subrip}", run = "mediainfo" },
+ # ]
xfzv commented 3 days ago

Tracked in #7