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}}
|
||||
_spectator_group_subject(\{{what}})
|
||||
|
||||
def self._spectator_metadata
|
||||
def self._spectator_tags
|
||||
\{% if tags.empty? && metadata.empty? %}
|
||||
super
|
||||
\{% else %}
|
||||
super.merge(
|
||||
\{% for tag in tags %}
|
||||
\{{tag.id.stringify}}: true,
|
||||
super.concat({\{{tags.map(&.id.stringify).splat}}}).tap do |tags|
|
||||
\{% for k, v in metadata %}
|
||||
cond = begin
|
||||
\{{v}}
|
||||
end
|
||||
if cond
|
||||
tags.add(\{{k.id.stringify}})
|
||||
else
|
||||
tags.remove(\{{k.id.stringify}})
|
||||
end
|
||||
\{% end %}
|
||||
\{{metadata.double_splat}}
|
||||
)
|
||||
end
|
||||
\{% end %}
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue