diff options
author | dec05eba <dec05eba@protonmail.com> | 2022-02-11 17:43:58 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2022-02-11 17:43:58 +0100 |
commit | 515477b5d597b807b27d2f95950b937ab8684c00 (patch) | |
tree | 48b258a58087f842be9a20d4601e095140ac2b82 /src/Storage.cpp | |
parent | 6f2648422107c8760b3e7717fc9b6693e37fcd92 (diff) |
Add read local manga to automedia seen
Diffstat (limited to 'src/Storage.cpp')
-rw-r--r-- | src/Storage.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/Storage.cpp b/src/Storage.cpp index a0f20e4..f4732b8 100644 --- a/src/Storage.cpp +++ b/src/Storage.cpp @@ -163,6 +163,13 @@ namespace QuickMedia { FILE *file = fopen_eintr(path.data.c_str(), "rb"); if(!file) return -errno; + + int fd = fileno(file); + struct stat s; + if(fstat(fd, &s) == -1 || !S_ISREG(s.st_mode)) { + fclose(file); + return -1; + } fseek_eintr(file, 0, SEEK_END); long file_size = ftell(file); |