From 02c84caa9b2e41dbd26b05bce1ac3dfb999538a0 Mon Sep 17 00:00:00 2001 From: Clint Gibler Date: Fri, 3 Jul 2020 16:24:27 -0700 Subject: [PATCH] Update filemagic to new API to fix meme crash --- src/promnesia/sources/auto.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/promnesia/sources/auto.py b/src/promnesia/sources/auto.py index 282c83ff..4290e7f1 100644 --- a/src/promnesia/sources/auto.py +++ b/src/promnesia/sources/auto.py @@ -19,11 +19,11 @@ @lru_cache(1) def _magic(): import magic # type: ignore - return magic.Magic(mime=True) + return magic.Magic(flags=magic.MAGIC_MIME_TYPE) def mime(path: PathIsh) -> str: - return _magic().from_file(str(path)) + return _magic().id_filename(str(path)) Ctx = Sequence[str]