mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Change groups from metadata to tags
This commit is contained in:
parent
71a497b148
commit
e77d6f0a4f
1 changed files with 12 additions and 6 deletions
|
@ -16,16 +16,22 @@ module Spectator::DSL
|
||||||
class Group\%group < \{{@type.id}}
|
class Group\%group < \{{@type.id}}
|
||||||
_spectator_group_subject(\{{what}})
|
_spectator_group_subject(\{{what}})
|
||||||
|
|
||||||
def self._spectator_metadata
|
def self._spectator_tags
|
||||||
\{% if tags.empty? && metadata.empty? %}
|
\{% if tags.empty? && metadata.empty? %}
|
||||||
super
|
super
|
||||||
\{% else %}
|
\{% else %}
|
||||||
super.merge(
|
super.concat({\{{tags.map(&.id.stringify).splat}}}).tap do |tags|
|
||||||
\{% for tag in tags %}
|
\{% for k, v in metadata %}
|
||||||
\{{tag.id.stringify}}: true,
|
cond = begin
|
||||||
|
\{{v}}
|
||||||
|
end
|
||||||
|
if cond
|
||||||
|
tags.add(\{{k.id.stringify}})
|
||||||
|
else
|
||||||
|
tags.remove(\{{k.id.stringify}})
|
||||||
|
end
|
||||||
\{% end %}
|
\{% end %}
|
||||||
\{{metadata.double_splat}}
|
end
|
||||||
)
|
|
||||||
\{% end %}
|
\{% end %}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue