Compare commits

..

No commits in common. "fedd9ac3a077030daf359f1682014315f80f1d55" and "844ad5452e64a3b5e3279d90b801ab2d04a7acb3" have entirely different histories.

5 changed files with 8 additions and 26 deletions

View File

@ -119,7 +119,7 @@ def file_handler(message):
def scan(message):
tfm_tb.reply_to(message, "Scanning...")
log.info("Scanning...")
scan_dir = "/srv/share/hfs/misc/tfm_temp/scan"
scan_dir = "/srv/hfs/misc/tfm_temp/scan"
files = []
for file in os.listdir(scan_dir):
new_file = {"name": file}
@ -127,11 +127,7 @@ def scan(message):
if not os.path.isfile(file):
continue
new_file["path"] = file
try:
exif = ljson(os.popen(f"exiftool -json \"{file}\"").read())[0]
except Exception as e:
log.error("Error while parsing EXIF for file '%s': %s" % (file, e))
continue
exif = ljson(os.popen(f"exiftool -json \"{file}\"").read())[0]
dt = exif["FileModifyDate"]
if "SubSecDateTimeOriginal" in exif.keys():
dt = exif["SubSecDateTimeOriginal"]
@ -144,13 +140,9 @@ def scan(message):
dt = TZ.localize(datetime.strptime(dt, "%Y:%m:%d %H:%M:%S.%f"))
else:
try:
try:
dt = datetime.strptime(dt, "%Y:%m:%d %H:%M:%S%z")
except:
dt = TZ.localize(datetime.strptime(dt[:19], "%Y:%m:%d %H:%M:%S"))
dt = datetime.strptime(dt, "%Y:%m:%d %H:%M:%S%z")
except:
log.error("Broken date: %s\t%s" % (new_file, dt))
continue
dt = TZ.localize(datetime.strptime(dt, "%Y:%m:%d %H:%M:%S"))
new_file["datetime"] = dt
files.append(new_file)
tfm_tb.reply_to(message, f"{len(files)} files found.")

View File

@ -75,7 +75,7 @@ $(window).on("load", function (e) {
});
$("main").scroll(function (e) {
if ($(this).scrollTop() + $(this).innerHeight() >= $(this)[0].scrollHeight - 100) {
if ($(this).scrollTop() + $(this).innerHeight() >= $(this)[0].scrollHeight) {
files_load();
}
});

View File

@ -1,11 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<browserconfig>
<msapplication>
<tile>
<square70x70logo src="/images/ms-icon-70x70.png" />
<square150x150logo src="/images/ms-icon-150x150.png" />
<square310x310logo src="/images/ms-icon-310x310.png" />
<TileColor>#615880</TileColor>
</tile>
</msapplication>
</browserconfig>
<browserconfig><msapplication><tile><square70x70logo src="/images/ms-icon-70x70.png"/><square150x150logo src="/images/ms-icon-150x150.png"/><square310x310logo src="/images/ms-icon-310x310.png"/><TileColor>#5c913b</TileColor></tile></msapplication></browserconfig>

View File

@ -7,7 +7,6 @@
"scope": "/",
"display": "standalone",
"theme_color": "#615880",
"background_color": "#312F45",
"icons": [
{
"src": "\/images\/android-icon-36x36.png",

View File

@ -434,7 +434,7 @@ def thumb(file_id=None):
raise RuntimeError("File does not exist")
return send_file(
tfm_api.previewer.get_jpeg_preview(join(tfm_api.conf["Paths"]["Files"], file_id), height=160, width=160),
mimetype="image/jpeg"
mimetype=file["mime_name"]
)
except:
abort(404)
@ -453,7 +453,7 @@ def preview(file_id=None):
raise RuntimeError("File does not exist")
return send_file(
tfm_api.previewer.get_jpeg_preview(join(tfm_api.conf["Paths"]["Files"], file_id), height=1080, width=1920),
mimetype="image/jpeg"
mimetype=file["mime_name"]
)
except:
abort(404)