fix access times not being updated, update comments with spelling/dupe mistake

This commit is contained in:
Xevion
2019-12-24 23:06:32 -06:00
parent a86e0a7185
commit b3cf684272

View File

@@ -8,11 +8,12 @@ import re
import json import json
import subprocess import subprocess
# Retrieves the YouTubeAudio object relevant to the mediaid if available. If not, it facilitiates the creation and writing of one. # Retrieves the YouTubeAudio object relevant to the mediaid if available. If not, it facilitates the creation and writing of one.
# Also helps with access times. # Also helps with access times.
def get_youtube(mediaid): def get_youtube(mediaid):
audio = YouTubeAudio.query.get(mediaid) audio = YouTubeAudio.query.get(mediaid)
if audio is not None: if audio is not None:
audio.access()
return audio # sets the access time to now return audio # sets the access time to now
audio = YouTubeAudio(id=mediaid) audio = YouTubeAudio(id=mediaid)
audio.fill_metadata() audio.fill_metadata()
@@ -22,7 +23,7 @@ def get_youtube(mediaid):
db.session.commit() db.session.commit()
return audio return audio
# Returns the duration of a specificed media # Streams back the specified media back to the client
@app.route('/stream/<service>/<mediaid>') @app.route('/stream/<service>/<mediaid>')
def stream(service, mediaid): def stream(service, mediaid):
if service == 'youtube': if service == 'youtube':