forked from FrederikBaerentsen/BrickTracker
Fix RebrickableSet not using url in database for sets
This commit is contained in:
parent
6c342ec3f3
commit
d22ca2c7cb
@ -178,10 +178,6 @@
|
|||||||
# Default: https://rebrickable.com/parts/{number}/_/{color}
|
# Default: https://rebrickable.com/parts/{number}/_/{color}
|
||||||
# BK_REBRICKABLE_LINK_PART_PATTERN=
|
# BK_REBRICKABLE_LINK_PART_PATTERN=
|
||||||
|
|
||||||
# Optional: Pattern of the link to Rebrickable for a set. Will be passed to Python .format()
|
|
||||||
# Default: https://rebrickable.com/sets/{number}
|
|
||||||
# BK_REBRICKABLE_LINK_SET_PATTERN=
|
|
||||||
|
|
||||||
# Optional: Display Rebrickable links wherever applicable
|
# Optional: Display Rebrickable links wherever applicable
|
||||||
# Default: false
|
# Default: false
|
||||||
# Legacy name: LINKS
|
# Legacy name: LINKS
|
||||||
|
@ -43,7 +43,6 @@ CONFIG: Final[list[dict[str, Any]]] = [
|
|||||||
{'n': 'REBRICKABLE_IMAGE_NIL_MINIFIGURE', 'd': 'https://rebrickable.com/static/img/nil_mf.jpg'}, # noqa: E501
|
{'n': 'REBRICKABLE_IMAGE_NIL_MINIFIGURE', 'd': 'https://rebrickable.com/static/img/nil_mf.jpg'}, # noqa: E501
|
||||||
{'n': 'REBRICKABLE_LINK_MINIFIGURE_PATTERN', 'd': 'https://rebrickable.com/minifigs/{number}'}, # noqa: E501
|
{'n': 'REBRICKABLE_LINK_MINIFIGURE_PATTERN', 'd': 'https://rebrickable.com/minifigs/{number}'}, # noqa: E501
|
||||||
{'n': 'REBRICKABLE_LINK_PART_PATTERN', 'd': 'https://rebrickable.com/parts/{number}/_/{color}'}, # noqa: E501
|
{'n': 'REBRICKABLE_LINK_PART_PATTERN', 'd': 'https://rebrickable.com/parts/{number}/_/{color}'}, # noqa: E501
|
||||||
{'n': 'REBRICKABLE_LINK_SET_PATTERN', 'd': 'https://rebrickable.com/sets/{number}'}, # noqa: E501
|
|
||||||
{'n': 'REBRICKABLE_LINKS', 'e': 'LINKS', 'c': bool},
|
{'n': 'REBRICKABLE_LINKS', 'e': 'LINKS', 'c': bool},
|
||||||
{'n': 'REBRICKABLE_PAGE_SIZE', 'd': 100, 'c': int},
|
{'n': 'REBRICKABLE_PAGE_SIZE', 'd': 100, 'c': int},
|
||||||
{'n': 'RETIRED_SETS_FILE_URL', 'd': 'https://docs.google.com/spreadsheets/d/1rlYfEXtNKxUOZt2Mfv0H17DvK7bj6Pe0CuYwq6ay8WA/gviz/tq?tqx=out:csv&sheet=Sorted%20by%20Retirement%20Date'}, # noqa: E501
|
{'n': 'RETIRED_SETS_FILE_URL', 'd': 'https://docs.google.com/spreadsheets/d/1rlYfEXtNKxUOZt2Mfv0H17DvK7bj6Pe0CuYwq6ay8WA/gviz/tq?tqx=out:csv&sheet=Sorted%20by%20Retirement%20Date'}, # noqa: E501
|
||||||
|
@ -165,12 +165,7 @@ class RebrickableSet(BrickRecord):
|
|||||||
# Compute the url for the rebrickable page
|
# Compute the url for the rebrickable page
|
||||||
def url_for_rebrickable(self, /) -> str:
|
def url_for_rebrickable(self, /) -> str:
|
||||||
if current_app.config['REBRICKABLE_LINKS']:
|
if current_app.config['REBRICKABLE_LINKS']:
|
||||||
try:
|
return self.fields.url
|
||||||
return current_app.config['REBRICKABLE_LINK_SET_PATTERN'].format( # noqa: E501
|
|
||||||
number=self.fields.number,
|
|
||||||
)
|
|
||||||
except Exception:
|
|
||||||
pass
|
|
||||||
|
|
||||||
return ''
|
return ''
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user