Skip to content

Commit 2ffe3eb

Browse files
authored
Merge pull request #474 from karlomikus/develop
Fix wrong thumb url
2 parents bd8fd1d + 1c0e96d commit 2ffe3eb

16 files changed

+264
-241
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
# v5.2.4
2+
## Fixes
3+
- Fixed wrong thumbnail URL getting synced into search engine
4+
5+
# v5.2.3
6+
## Changes
7+
- Query string `state` is always being sent when using Authelia as SSO provider
8+
19
# v5.2.2
210
## Changes
311
- Automatic ingredient units filler function now tries to convert to default bar unit

app/Http/Controllers/CocktailController.php

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -37,32 +37,32 @@ class CocktailController extends Controller
3737
new BAO\Parameters\PageParameter(),
3838
new BAO\Parameters\PerPageParameter(),
3939
new OAT\Parameter(name: 'filter', in: 'query', description: 'Filter by attributes', explode: true, style: 'deepObject', schema: new OAT\Schema(type: 'object', properties: [
40-
new OAT\Property(property: 'id', type: 'string'),
41-
new OAT\Property(property: 'name', type: 'string'),
42-
new OAT\Property(property: 'ingredient_name', type: 'string'),
43-
new OAT\Property(property: 'tag_id', type: 'string'),
44-
new OAT\Property(property: 'created_user_id', type: 'string'),
45-
new OAT\Property(property: 'glass_id', type: 'string'),
46-
new OAT\Property(property: 'cocktail_method_id', type: 'string'),
47-
new OAT\Property(property: 'collection_id', type: 'string'),
48-
new OAT\Property(property: 'favorites', type: 'boolean'),
49-
new OAT\Property(property: 'on_shelf', type: 'boolean'),
50-
new OAT\Property(property: 'bar_shelf', type: 'boolean'),
51-
new OAT\Property(property: 'user_shelves', type: 'string'),
52-
new OAT\Property(property: 'shelf_ingredients', type: 'string'),
53-
new OAT\Property(property: 'is_public', type: 'boolean'),
54-
new OAT\Property(property: 'user_rating_min', type: 'string'),
55-
new OAT\Property(property: 'user_rating_max', type: 'string'),
56-
new OAT\Property(property: 'average_rating_min', type: 'string'),
57-
new OAT\Property(property: 'average_rating_max', type: 'string'),
58-
new OAT\Property(property: 'abv_min', type: 'string'),
59-
new OAT\Property(property: 'abv_max', type: 'string'),
60-
new OAT\Property(property: 'main_ingredient_id', type: 'string'),
61-
new OAT\Property(property: 'total_ingredients', type: 'string'),
62-
new OAT\Property(property: 'missing_ingredients', type: 'string'),
63-
new OAT\Property(property: 'missing_bar_ingredients', type: 'string'),
64-
new OAT\Property(property: 'specific_ingredients', type: 'string'),
65-
new OAT\Property(property: 'ignore_ingredients', type: 'string'),
40+
new OAT\Property(property: 'id', type: 'string', description: 'Filter by cocktail IDs'),
41+
new OAT\Property(property: 'name', type: 'string', description: 'Filter by cocktail names (fuzzy search)'),
42+
new OAT\Property(property: 'ingredient_name', type: 'string', description: 'Filter by cocktail ingredient names (fuzzy search)'),
43+
new OAT\Property(property: 'tag_id', type: 'string', description: 'Filter by tag IDs'),
44+
new OAT\Property(property: 'created_user_id', type: 'string', description: 'Filter by creator IDs'),
45+
new OAT\Property(property: 'glass_id', type: 'string', description: 'Filter by glass IDs'),
46+
new OAT\Property(property: 'cocktail_method_id', type: 'string', description: 'Filter by cocktail method IDs'),
47+
new OAT\Property(property: 'collection_id', type: 'string', description: 'Filter by collection IDs'),
48+
new OAT\Property(property: 'favorites', type: 'boolean', description: 'Show only user favorites'),
49+
new OAT\Property(property: 'on_shelf', type: 'boolean', description: 'Show only cocktails on the user\'s shelf'),
50+
new OAT\Property(property: 'bar_shelf', type: 'boolean', description: 'Show only cocktails on the bar shelf'),
51+
new OAT\Property(property: 'user_shelves', type: 'string', description: 'Show only cocktails on the user\'s shelves. Comma separated list of user IDs'),
52+
new OAT\Property(property: 'shelf_ingredients', type: 'string', description: 'Show only cocktails that can be made with the given ingredients. Used as on-the-fly custom shelf filter'),
53+
new OAT\Property(property: 'is_public', type: 'boolean', description: 'Show only cocktails with public links'),
54+
new OAT\Property(property: 'user_rating_min', type: 'string', description: 'Filter by greater than or equal user rating'),
55+
new OAT\Property(property: 'user_rating_max', type: 'string', description: 'Filter by less than or equal user rating'),
56+
new OAT\Property(property: 'average_rating_min', type: 'string', description: 'Filter by greater than or equal average rating'),
57+
new OAT\Property(property: 'average_rating_max', type: 'string', description: 'Filter by less than or equal average rating'),
58+
new OAT\Property(property: 'abv_min', type: 'string', description: 'Filter by greater than or equal ABV'),
59+
new OAT\Property(property: 'abv_max', type: 'string', description: 'Filter by less than or equal ABV'),
60+
new OAT\Property(property: 'main_ingredient_id', type: 'string', description: 'Show only cocktails whose main ingredient is in the given list. Comma separated list of ingredient IDs'),
61+
new OAT\Property(property: 'total_ingredients', type: 'string', description: 'Filter by total number of ingredients'),
62+
new OAT\Property(property: 'missing_ingredients', type: 'string', description: 'Filter by total number of missing ingredients'),
63+
new OAT\Property(property: 'missing_bar_ingredients', type: 'string', description: 'Filter by total number of missing bar ingredients'),
64+
new OAT\Property(property: 'specific_ingredients', type: 'string', description: 'Show cocktails that contain given ingredient IDs'),
65+
new OAT\Property(property: 'ignore_ingredients', type: 'string', description: 'Show cocktails that do not contain given ingredient IDs'),
6666
])),
6767
new OAT\Parameter(name: 'sort', in: 'query', description: 'Sort by attributes. Available attributes: `name`, `created_at`, `average_rating`, `user_rating`, `abv`, `total_ingredients`, `missing_ingredients`, `missing_bar_ingredients`, `favorited_at`, `random`.', schema: new OAT\Schema(type: 'string')),
6868
new OAT\Parameter(name: 'include', in: 'query', description: 'Include additional relationships. Available relations: `glass`, `method`, `user`, `navigation`, `utensils`, `createdUser`, `updatedUser`, `images`, `tags`, `ingredients.ingredient`, `ratings`.', schema: new OAT\Schema(type: 'string')),

app/Http/Controllers/IngredientController.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,16 @@ class IngredientController extends Controller
3333
new BAO\Parameters\PageParameter(),
3434
new BAO\Parameters\PerPageParameter(),
3535
new OAT\Parameter(name: 'filter', in: 'query', description: 'Filter by attributes', explode: true, style: 'deepObject', schema: new OAT\Schema(type: 'object', properties: [
36-
new OAT\Property(property: 'id', type: 'integer'),
37-
new OAT\Property(property: 'name', type: 'string'),
38-
new OAT\Property(property: 'name_exact', type: 'string'),
39-
new OAT\Property(property: 'origin', type: 'string'),
40-
new OAT\Property(property: 'created_user_id', type: 'integer'),
41-
new OAT\Property(property: 'on_shopping_list', type: 'boolean'),
42-
new OAT\Property(property: 'on_shelf', type: 'boolean'),
43-
new OAT\Property(property: 'bar_shelf', type: 'boolean'),
44-
new OAT\Property(property: 'strength_min', type: 'float'),
45-
new OAT\Property(property: 'strength_max', type: 'float'),
36+
new OAT\Property(property: 'id', type: 'integer', description: 'Filter by ingredient id'),
37+
new OAT\Property(property: 'name', type: 'string', description: 'Filter by ingredient name (fuzzy search)'),
38+
new OAT\Property(property: 'name_exact', type: 'string', description: 'Filter by ingredient name (exact match)'),
39+
new OAT\Property(property: 'origin', type: 'string', description: 'Filter by ingredient origin'),
40+
new OAT\Property(property: 'created_user_id', type: 'integer', description: 'Filter by user id who created the ingredient'),
41+
new OAT\Property(property: 'on_shopping_list', type: 'boolean', description: 'Show only ingredients that are on the shopping list'),
42+
new OAT\Property(property: 'on_shelf', type: 'boolean', description: 'Show only ingredients that are on the shelf'),
43+
new OAT\Property(property: 'bar_shelf', type: 'boolean', description: 'Show only ingredients that are on the bar shelf'),
44+
new OAT\Property(property: 'strength_min', type: 'float', description: 'Show only ingredients with strength greater than or equal to given value'),
45+
new OAT\Property(property: 'strength_max', type: 'float', description: 'Show only ingredients with strength less than or equal to given value'),
4646
new OAT\Property(property: 'main_ingredients', type: 'string', description: 'Show only ingredients that are used as main ingredients in cocktails'),
4747
new OAT\Property(property: 'complex', type: 'boolean', description: 'Show only ingredients that can be made with other ingredients'),
4848
new OAT\Property(property: 'parent_ingredient_id', type: 'integer', description: 'Show only direct children of given ingredient. Use null as value to get ingredients without parent ingredient'),

app/Http/Filters/CocktailMethodQueryFilter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
use Kami\Cocktail\Models\CocktailMethod;
1010

1111
/**
12-
* @mixin \Kami\Cocktail\Models\CocktailMethod
12+
* @extends \Spatie\QueryBuilder\QueryBuilder<CocktailMethod>
1313
*/
1414
final class CocktailMethodQueryFilter extends QueryBuilder
1515
{

app/Http/Filters/CocktailQueryFilter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
use Kami\Cocktail\Services\CocktailService;
1414

1515
/**
16-
* @mixin \Kami\Cocktail\Models\Cocktail
16+
* @extends \Spatie\QueryBuilder\QueryBuilder<Cocktail>
1717
*/
1818
final class CocktailQueryFilter extends QueryBuilder
1919
{

app/Http/Filters/CollectionQueryFilter.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
use Spatie\QueryBuilder\AllowedFilter;
99
use Kami\Cocktail\Models\Collection as ItemsCollection;
1010

11+
/**
12+
* @extends \Spatie\QueryBuilder\QueryBuilder<ItemsCollection>
13+
*/
1114
final class CollectionQueryFilter extends QueryBuilder
1215
{
1316
public function __construct()

app/Http/Filters/GlassQueryFilter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
use Spatie\QueryBuilder\AllowedFilter;
1010

1111
/**
12-
* @mixin \Kami\Cocktail\Models\Glass
12+
* @extends \Spatie\QueryBuilder\QueryBuilder<Glass>
1313
*/
1414
final class GlassQueryFilter extends QueryBuilder
1515
{

app/Http/Filters/IngredientQueryFilter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
use Kami\Cocktail\Services\IngredientService;
1212

1313
/**
14-
* @mixin \Kami\Cocktail\Models\Ingredient
14+
* @extends \Spatie\QueryBuilder\QueryBuilder<Ingredient>
1515
*/
1616
final class IngredientQueryFilter extends QueryBuilder
1717
{

app/Http/Filters/NoteQueryFilter.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
use Spatie\QueryBuilder\QueryBuilder;
99
use Spatie\QueryBuilder\AllowedFilter;
1010

11+
/**
12+
* @extends \Spatie\QueryBuilder\QueryBuilder<Note>
13+
*/
1114
final class NoteQueryFilter extends QueryBuilder
1215
{
1316
public function __construct()

app/Models/Concerns/HasImages.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ public function getMainImageThumbUrl(bool $absolute = true): ?string
3636
return null;
3737
}
3838

39+
if (!empty(config('app.url'))) {
40+
$path = route('images.thumb', ['id' => $this->getMainImage()->id], false);
41+
42+
return rtrim(config('app.url'), '/') . '/' . ltrim($path, '/');
43+
}
44+
3945
return route('images.thumb', ['id' => $this->getMainImage()->id], $absolute);
4046
}
4147

0 commit comments

Comments
 (0)