mirror of
https://github.com/gotson/komga.git
synced 2025-01-09 04:08:00 +08:00
fix: fix rar books with potential issues
fix the media type generated prior to tika 1.24 this prevented extension repair and cbz conversion fix rar files that could have been incorrectly analyzed prior to 0.91.3
This commit is contained in:
parent
740fa6583a
commit
8befde0ea8
@ -0,0 +1,18 @@
|
||||
-- fix media type for files analyzed with tika 1.23 or before which didn't get the rar version
|
||||
update MEDIA
|
||||
set MEDIA_TYPE = 'application/x-rar-compressed; version=4'
|
||||
where MEDIA_TYPE = 'application/x-rar-compressed'
|
||||
and STATUS = 'READY';
|
||||
|
||||
-- rar files that could have had an incorrect analysis are marked at OUTDATED to be ra-analyzed
|
||||
update MEDIA
|
||||
set STATUS = 'OUTDATED'
|
||||
where BOOK_ID in (
|
||||
select F.BOOK_ID
|
||||
from MEDIA_FILE F
|
||||
left join MEDIA M on F.BOOK_ID = M.BOOK_ID
|
||||
where F.FILE_NAME like '%.%'
|
||||
and M.MEDIA_TYPE like 'application/x-rar-compressed%'
|
||||
and lower(replace(F.FILE_NAME, rtrim(F.FILE_NAME, replace(F.FILE_NAME, '.', '')), ''))
|
||||
in ('jpg', 'jpeg', 'webp', 'tiff', 'tif', 'gif', 'png', 'bmp')
|
||||
);
|
Loading…
Reference in New Issue
Block a user