mirror of
https://git.vectorsigma.ru/public/photoview.git
synced 2026-08-03 22:19:07 +00:00
Different small improvements to search
- Make photos link to its album - Implement Photo -> Album resolver - Highlight query in search - Hide search bar when not logged in
This commit is contained in:
@@ -152,30 +152,9 @@ func (r *photoResolver) Thumbnail(ctx context.Context, obj *models.Photo) (*mode
|
||||
return url, nil
|
||||
}
|
||||
|
||||
// func processPhoto(db *sql.DB, photo *models.Photo) error {
|
||||
// tx, err := db.Begin()
|
||||
// if err != nil {
|
||||
// return err
|
||||
// }
|
||||
|
||||
// err = scanner.ProcessPhoto(tx, photo)
|
||||
// if err != nil {
|
||||
// tx.Rollback()
|
||||
// log.Printf("ERROR: Could not process photo: %s\n", err)
|
||||
// return errors.New(fmt.Sprintf("Could not process photo: %s\n", err))
|
||||
// }
|
||||
|
||||
// err = tx.Commit()
|
||||
// if err != nil {
|
||||
// log.Printf("ERROR: Could not commit photo after process to db: %s\n", err)
|
||||
// return err
|
||||
// }
|
||||
|
||||
// return nil
|
||||
// }
|
||||
|
||||
func (r *photoResolver) Album(ctx context.Context, obj *models.Photo) (*models.Album, error) {
|
||||
panic("not implemented")
|
||||
row := r.Database.QueryRow("SELECT album.* from photo JOIN album ON photo.album_id = album.album_id WHERE photo_id = ?", obj.PhotoID)
|
||||
return models.NewAlbumFromRow(row)
|
||||
}
|
||||
|
||||
func (r *photoResolver) Exif(ctx context.Context, obj *models.Photo) (*models.PhotoEXIF, error) {
|
||||
|
||||
Reference in New Issue
Block a user