removed debugs, added medainfo library to README for installation, added first-pass of thumbnauil, but no code for the actual thumbnail data yet

This commit is contained in:
2021-01-10 17:49:12 +11:00
parent 6807e44228
commit 2e4aec7772
3 changed files with 9 additions and 5 deletions

4
README
View File

@@ -1,5 +1,9 @@
In here we can put instructions on how to run this / any general info
ubuntu packages:
sudo apt-get install -y mediainfo
pip packages:
* pymediainfo
* PIL (should be there by default)

View File

@@ -21,7 +21,6 @@ from settings import Settings
# Utility Functions for Files
################################################################################
def md5(fname):
print("Trying to MD5 - {}".format(fname))
hash_md5 = hashlib.md5()
with open(fname, "rb") as f:
for chunk in iter(lambda: f.read(4096), b""):
@@ -78,7 +77,6 @@ def photos():
fsize = round(os.stat(file).st_size/(1024*1024))
view_list.append( Photos( name=file, type=ftype, size_MB=fsize, hash=fhash ))
print(file_list)
return render_template("photos.html", page_title='View Photos', view_path=view_path, file_list=view_list, alert=st.GetAlert(), message=st.GetMessage() )
@@ -87,7 +85,6 @@ def isImage(file):
img = Image.open(file)
return True
except:
print('not an image')
return False
def isVideo(file):
@@ -97,5 +94,5 @@ def isVideo(file):
if track.track_type == "Video":
return True
return False
except:
except Exception as e:
return False

View File

@@ -16,6 +16,9 @@
<i class="fas fa-question-circle"></i>
{% endif %}
&nbsp;{{obj.name}}
{% if obj.type=="Image" %}
<img width="64" height="64" src="data:image/gif;base64,{{obj.thumb}}"></img>
{% endif %}
</td></td><td>{{obj.size_MB}}</td><td>{{obj.hash}}</tr>
{% endfor %}
</tbody></table>