mirror of
https://git.vectorsigma.ru/public/tubearchivist.git
synced 2026-08-05 01:29:24 +00:00
fix channel subs null value extraction, #803
This commit is contained in:
@@ -157,8 +157,18 @@ class YoutubeChannel(YouTubeItem):
|
|||||||
# add ingest pipeline
|
# add ingest pipeline
|
||||||
processors = []
|
processors = []
|
||||||
for field, value in self.json_data.items():
|
for field, value in self.json_data.items():
|
||||||
line = {"set": {"field": "channel." + field, "value": value}}
|
if value is None:
|
||||||
|
line = {
|
||||||
|
"script": {
|
||||||
|
"lang": "painless",
|
||||||
|
"source": f"ctx['{field}'] = null;",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else:
|
||||||
|
line = {"set": {"field": "channel." + field, "value": value}}
|
||||||
|
|
||||||
processors.append(line)
|
processors.append(line)
|
||||||
|
|
||||||
data = {"description": self.youtube_id, "processors": processors}
|
data = {"description": self.youtube_id, "processors": processors}
|
||||||
ingest_path = f"_ingest/pipeline/{self.youtube_id}"
|
ingest_path = f"_ingest/pipeline/{self.youtube_id}"
|
||||||
_, _ = ElasticWrap(ingest_path).put(data)
|
_, _ = ElasticWrap(ingest_path).put(data)
|
||||||
|
|||||||
@@ -49,7 +49,9 @@ const ChannelList = ({ channelList, refreshChannelList }: ChannelListProps) => {
|
|||||||
<h3>
|
<h3>
|
||||||
<Link to={Routes.Channel(channel.channel_id)}>{channel.channel_name}</Link>
|
<Link to={Routes.Channel(channel.channel_id)}>{channel.channel_name}</Link>
|
||||||
</h3>
|
</h3>
|
||||||
<FormattedNumber text="Subscribers:" number={channel.channel_subs} />
|
{channel.channel_subs !== null && (
|
||||||
|
<FormattedNumber text="Subscribers:" number={channel.channel_subs} />
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="info-box-item">
|
<div className="info-box-item">
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ const ChannelOverview = ({
|
|||||||
<Link to={Routes.ChannelVideo(channelId)}>{channelname}</Link>
|
<Link to={Routes.ChannelVideo(channelId)}>{channelname}</Link>
|
||||||
</h3>
|
</h3>
|
||||||
|
|
||||||
<FormattedNumber text="Subscribers:" number={channelSubs} />
|
{channelSubs !== null && <FormattedNumber text="Subscribers:" number={channelSubs} />}
|
||||||
|
|
||||||
{isAdmin && (
|
{isAdmin && (
|
||||||
<>
|
<>
|
||||||
|
|||||||
Reference in New Issue
Block a user