2 Commits

Author SHA1 Message Date
1cbfd6abe8 Changed hashing behavior 2023-02-15 16:08:01 +01:00
1f867630f4 Temporarily disabled models (causes #1) 2023-02-15 16:07:51 +01:00
2 changed files with 5 additions and 5 deletions

View File

@@ -13,7 +13,7 @@ from fastapi import HTTPException, Security
from fastapi.responses import UJSONResponse, Response
from starlette.status import HTTP_204_NO_CONTENT, HTTP_404_NOT_FOUND, HTTP_406_NOT_ACCEPTABLE, HTTP_409_CONFLICT
@app.post("/albums", response_class=UJSONResponse, response_model=Album, description="Create album with name and title")
@app.post("/albums", response_class=UJSONResponse, description="Create album with name and title") # response_model=Album,
async def album_create(name: str, title: str, current_user: User = Security(get_current_active_user, scopes=["albums.write"])):
if re.search(re.compile('^[a-z,0-9,_]*$'), name) is False:
@@ -51,7 +51,7 @@ async def album_find(q: str, current_user: User = Security(get_current_active_us
return UJSONResponse(output)
@app.patch("/albums/{id}", response_class=UJSONResponse, response_model=AlbumModified, description="Modify album's name or title by id")
@app.patch("/albums/{id}", response_class=UJSONResponse, description="Modify album's name or title by id") # response_model=AlbumModified
async def album_patch(id: str, name: Union[str, None] = None, title: Union[str, None] = None, cover: Union[str, None] = None, current_user: User = Security(get_current_active_user, scopes=["albums.write"])):
try:
@@ -96,7 +96,7 @@ async def album_patch(id: str, name: Union[str, None] = None, title: Union[str,
}
)
@app.put("/albums/{id}", response_class=UJSONResponse, response_model=AlbumModified, description="Modify album's name and title by id")
@app.put("/albums/{id}", response_class=UJSONResponse, description="Modify album's name and title by id") # response_model=AlbumModified
async def album_put(id: str, name: str, title: str, cover: str, current_user: User = Security(get_current_active_user, scopes=["albums.write"])):
try:

View File

@@ -52,7 +52,7 @@ async def get_duplicates(hash: str, album: str) -> list:
)
except ValueError:
continue
print("{0:<30} {1}".format(image_name, distance), flush=True)
if distance <= 0.25:
# print("{0:<30} {1}".format(image_name, distance), flush=True)
if distance <= 0.1:
duplicates.append({"id": cache[image_name][0], "filename": image_name, "difference": distance})
return duplicates