Naslovnica: razmik po skupini izvajalca (Rier = Kastelruther Spatzen), Beliebt brez podvojitev iz bazena
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
import { artistKey } from "@/lib/artists";
|
||||
import { artistGroup } from "@/lib/artists";
|
||||
import { useState, useEffect, useCallback } from "react";
|
||||
import { Globe, ExternalLink } from "lucide-react";
|
||||
|
||||
@@ -27,13 +27,13 @@ export function BreakingNewsWidget() {
|
||||
const recent: string[] = [];
|
||||
while (rest.length) {
|
||||
let idx = rest.findIndex((n: any) => {
|
||||
const k = artistKey(n?.title || "");
|
||||
const k = artistGroup(n?.title || "");
|
||||
return !k || !recent.includes(k);
|
||||
});
|
||||
if (idx < 0) idx = 0;
|
||||
const n = rest.splice(idx, 1)[0];
|
||||
out.push(n);
|
||||
recent.push(artistKey((n as any)?.title || ""));
|
||||
recent.push(artistGroup((n as any)?.title || ""));
|
||||
if (recent.length >= 5) recent.shift();
|
||||
}
|
||||
return out;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
import { artistKey } from "@/lib/artists";
|
||||
import { artistGroup } from "@/lib/artists";
|
||||
import { useState, useEffect, useCallback } from "react";
|
||||
import { Newspaper, ExternalLink } from "lucide-react";
|
||||
|
||||
@@ -27,13 +27,13 @@ export function NewsWidget() {
|
||||
const recent: string[] = [];
|
||||
while (rest.length) {
|
||||
let idx = rest.findIndex((n: any) => {
|
||||
const k = artistKey(n?.title || "");
|
||||
const k = artistGroup(n?.title || "");
|
||||
return !k || !recent.includes(k);
|
||||
});
|
||||
if (idx < 0) idx = 0;
|
||||
const n = rest.splice(idx, 1)[0];
|
||||
out.push(n);
|
||||
recent.push(artistKey((n as any)?.title || ""));
|
||||
recent.push(artistGroup((n as any)?.title || ""));
|
||||
if (recent.length >= 5) recent.shift();
|
||||
}
|
||||
return out;
|
||||
|
||||
Reference in New Issue
Block a user