unmatched faces now sorts size of face desc, and is slightly prettier -- still slow and only takes you to the file anyway, might optimise that later. still no code to auto deal with unmatched face, but will add some capabilities next. Also, remembered last dir when file_ip/sp/bin. Also throw error if try to find unknown person - happened since I allowed the back/forward.
This commit is contained in:
16
options.py
16
options.py
@@ -21,9 +21,11 @@ class PA_PREF(db.Model):
|
||||
size = db.Column(db.Integer, unique=False, nullable=False )
|
||||
folders = db.Column(db.Boolean, unique=False, nullable=False )
|
||||
fullscreen = db.Column(db.Boolean, unique=False, nullable=False )
|
||||
root = db.Column(db.String, unique=False, nullable=False )
|
||||
cwd = db.Column(db.String, unique=False, nullable=False )
|
||||
|
||||
def __repr__(self):
|
||||
return f"<pa_user_dn: {self.pa_user_dn}, path_type: {self.path_type}, noo: {self.noo}, grouping: {self.grouping}, how_many: {self.how_many}, st_offset: {self.st_offset}, size: {self.size}, folders: {self.folders}>"
|
||||
return f"<pa_user_dn: {self.pa_user_dn}, path_type: {self.path_type}, noo: {self.noo}, grouping: {self.grouping}, how_many: {self.how_many}, st_offset: {self.st_offset}, size: {self.size}, folders: {self.folders}, root: {self.root}, cwd: {self.cwd}>"
|
||||
|
||||
|
||||
################################################################################
|
||||
@@ -85,14 +87,16 @@ class Options(PA):
|
||||
self.how_many=pref.how_many
|
||||
self.offset=pref.st_offset
|
||||
self.size=pref.size
|
||||
self.root=pref.root
|
||||
self.cwd=pref.cwd
|
||||
else:
|
||||
self.grouping="None"
|
||||
self.how_many="50"
|
||||
self.offset="0"
|
||||
self.size="128"
|
||||
self.root='static/' + self.path_type
|
||||
self.cwd=self.root
|
||||
|
||||
self.cwd='static/' + self.path_type
|
||||
self.root=self.cwd
|
||||
|
||||
# the above are defaults, if we are here, then we have current values, use them instead if they are set -- AI: searches dont set them so then we use those in the DB first
|
||||
if request.method=="POST":
|
||||
@@ -134,7 +138,7 @@ class Options(PA):
|
||||
pref=PA_PREF.query.filter(PA_PREF.pa_user_dn==current_user.dn,PA_PREF.path_type==self.path_type).first()
|
||||
if not pref:
|
||||
pref=PA_PREF( pa_user_dn=current_user.dn, path_type=self.path_type, noo=self.noo, grouping=self.grouping, how_many=self.how_many,
|
||||
st_offset=self.offset, size=self.size, folders=self.folders)
|
||||
st_offset=self.offset, size=self.size, folders=self.folders, root=self.root, cwd=self.cwd)
|
||||
else:
|
||||
pref.noo=self.noo
|
||||
pref.grouping=self.grouping
|
||||
@@ -142,10 +146,14 @@ class Options(PA):
|
||||
pref.st_offset=self.offset
|
||||
pref.size=self.size
|
||||
pref.folders=self.folders
|
||||
pref.root = self.root
|
||||
pref.cwd = self.cwd
|
||||
|
||||
db.session.add(pref)
|
||||
db.session.commit()
|
||||
|
||||
return
|
||||
|
||||
################################################################################
|
||||
# /prefs -> GET only -> prints out list of all prefs (simple for now)
|
||||
################################################################################
|
||||
|
||||
Reference in New Issue
Block a user