diff --git a/image-index b/image-index index a1ea25f..3e5b6be 100755 --- a/image-index +++ b/image-index @@ -244,9 +244,10 @@ class metatable(database): self.collist=["NAME","ALIAS"] super().__init__(filepath) - def add_index(self,val,alias): - randhex=get_randhex() - val=re.sub('[ ?!/\\:!*"<>|]', '', val) + def add_index(self,val,alias,randhex=None): + if not randhex: + randhex=get_randhex() + val=re.sub('[ ,?!/\\:!*"<>|]', '', val) super().add_index([val[:8] + "-" + randhex,alias]) def check_index(self,typ): @@ -282,6 +283,12 @@ class metatable(database): def search_index(self,args,quiet=True): selection=[] selection=self.sql_compare_list("*", [args], selection,True) + if selection[0] == ".": + slist=args.split(" ") + selection=self.sql_compare_list("*", slist, [],False) + if len(selection) > 1: + print("Please enter a more specific search query!") + return "." selection=self.select_index(selection,quiet) return selection