Skip to content

Commit

Permalink
Merge pull request #771 from HolodexNet/dev
Browse files Browse the repository at this point in the history
Deploy
  • Loading branch information
sphinxrave authored May 28, 2024
2 parents 6e6bdd4 + 96d5730 commit fd849ea
Show file tree
Hide file tree
Showing 25 changed files with 164 additions and 83 deletions.
2 changes: 1 addition & 1 deletion src/components/common/ReportDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
:value="reason.value"
hide-details="true"
class="shrink mt-2"
@click="reason.text.includes('mention') && suggestedMentions === null ? loadMentions() : null"
@click="reason.value.includes('mention') && suggestedMentions === null ? loadMentions() : null"
/>
<br>
<span v-if="selectedReasons.includes('Incorrect video topic')">
Expand Down
32 changes: 24 additions & 8 deletions src/components/media/SongSearch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,10 @@ export default {
this.isLoading = true;
const [md, res, resEn] = await Promise.all([
this.searchMusicdex(query),
this.searchAutocomplete(query, "ja_jp"),
this.searchAutocomplete(query, "en_us"),
this.searchRegions(query, "ja_jp"),
this.searchRegions(query, "en_us"),
]);
const lookupEn = resEn.results || [];
const lookupEn = resEn || [];
console.log(lookupEn);
const fnLookupFn = (id, name, altName) => {
const foundEn = lookupEn.find((x) => x.trackId === id);
Expand All @@ -177,11 +177,11 @@ export default {
}
return altName || name;
};
if (res && res.results) {
console.log(res.results);
if (res) {
console.log(res);
this.fromApi = [
...md.slice(0, 3),
...res.results.map(
...res.map(
({
trackId,
collectionName,
Expand Down Expand Up @@ -211,15 +211,31 @@ export default {
// console.log(res);
return res;
},
async searchAutocomplete(query, lang = "ja_jp") {
async searchAutocomplete(query, lang = "ja_jp", country = "JP") {
return jsonp("https://itunes.apple.com/search", {
term: query,
entity: "musicTrack",
country: "JP",
country,
limit: 10,
lang,
});
},
async searchRegions(query, lang = "ja_jp", regions: Array<String> = ['JP', 'US']) {
// Order regions by highest to lowest priority; missing IDs will merge in.
const regionSongs = [];
let parsedIDs = [];
for (const r of regions) {
const queryed = await this.searchAutocomplete(query, lang, r);
const currentSongs = queryed.results || [];
for (const song of currentSongs) {
if (!parsedIDs.includes(song.trackId)) {
parsedIDs.push(song.trackId)
regionSongs.push(song)
}
}
};
return regionSongs;
},
async searchMusicdex(query) {
try {
const resp = await axiosInstance({
Expand Down
2 changes: 1 addition & 1 deletion src/components/multiview/VideoSelector.vue
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ export default {
ignoreBlock: false,
// only hide collabs when favorites tab
hideCollabs: this.shouldHideCollabs,
forOrg: this.isRealOrg && this.selectedOrg.name,
forOrg: this.isRealOrg ? this.selectedOrg.name : "none",
hideIgnoredTopics: true,
hidePlaceholder: this.hidePlaceholder,
hideMissing: this.hideMissing,
Expand Down
9 changes: 7 additions & 2 deletions src/components/nav/NavDrawer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,9 @@
<v-avatar v-if="vid.host_channel" :size="20">
<ChannelImg :channel="vid.host_channel" :size="20" />
</v-avatar>
{{ formatDurationUpcoming(vid.available_at) }}
<time v-if="vid.available_at" :datetime="vid.available_at" :title="absoluteTimeString(vid)">
{{ formatDurationUpcoming(vid.available_at) }}
</time>
</div>
</v-list-item-action-text>
</v-list-item>
Expand Down Expand Up @@ -152,7 +154,7 @@
import ChannelImg from "@/components/channel/ChannelImg.vue";
import ChannelInfo from "@/components/channel/ChannelInfo.vue";
import { langs } from "@/plugins/vuetify";
import { dayjs, formatDurationShort } from "@/utils/time";
import { dayjs, formatDurationShort, titleTimeString } from "@/utils/time";
import { mdiTuneVariant, mdiPatreon, mdiChevronUp, mdiChevronDown } from "@mdi/js";
import Settings from "@/views/Settings.vue";
import MusicdexLogo from "@/components/common/MusicdexLogo.vue";
Expand Down Expand Up @@ -298,6 +300,9 @@ export default {
const secs = dayjs(ts).diff(dayjs()) / 1000;
return formatDurationShort(Math.abs(secs));
},
absoluteTimeString(video) {
return titleTimeString(video.available_at);
},
isLive(video) {
return video.status === "live";
},
Expand Down
13 changes: 2 additions & 11 deletions src/components/video/VideoCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ import {
formatDuration,
formatDistance,
dayjs,
localizedDayjs,
titleTimeString,
} from "@/utils/time";
import { mdiBroadcast, mdiTwitch, mdiTwitter } from "@mdi/js";
import VideoCardMenu from "../common/VideoCardMenu.vue";
Expand Down Expand Up @@ -454,16 +454,7 @@ export default {
);
},
absoluteTimeString() {
const ts = localizedDayjs(this.data.available_at, this.lang);
const ts1 = ts.format(`${ts.isTomorrow() ? "ddd " : ""}LT zzz`);
const ts2 = ts
.tz("Asia/Tokyo")
.format(`${ts.isTomorrow() ? "ddd " : ""}LT zzz`);
if (ts1 === ts2) {
return ts1;
}
return `${ts1}\n${ts2}`;
return titleTimeString(this.data.available_at, this.lang);
},
videoTitle() {
return this.title;
Expand Down
13 changes: 3 additions & 10 deletions src/components/watch/WatchInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ import {
formatDistance,
dayjs,
localizedDayjs,
titleTimeString,
} from "@/utils/time";
import TruncatedText from "@/components/common/TruncatedText.vue";
import { mdiAt } from "@mdi/js";
Expand Down Expand Up @@ -202,15 +203,7 @@ export default {
return this.$store.state.settings.lang;
},
absoluteTimeString() {
const ts = localizedDayjs(this.video.available_at, this.lang);
const ts1 = ts.format(`${ts.isTomorrow() ? "ddd " : ""}LT zzz`);
const ts2 = ts
.tz("Asia/Tokyo")
.format(`${ts.isTomorrow() ? "ddd " : ""}LT zzz`);
if (ts1 === ts2) {
return ts1;
}
return `${ts1}\n${ts2}`;
return titleTimeString(this.video.available_at, this.lang);
},
formattedTime() {
switch (this.video.status) {
Expand Down Expand Up @@ -264,7 +257,7 @@ export default {
const topic = this.video.topic_id;
const capitalizedTopic = topic[0].toUpperCase() + topic.slice(1);
const { org } = this.video.channel;
let q = `type,value,text\ntopic,${topic},${capitalizedTopic}`;
let q = `type,value,text\ntopic,"${topic}","${capitalizedTopic}"`;
if (org) {
q += `\norg,${org},${org}`;
}
Expand Down
5 changes: 0 additions & 5 deletions src/locales/de-DE/ui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,6 @@ component:
uploadScript: TL-Skript hochladen
videoDescription:
description: Beschreibung
video:
comment: { }
description:
showLess: Weniger anzeigen
showMore: Mehr anzeigen
Expand Down Expand Up @@ -653,11 +651,8 @@ channelRequest:
EnglishNameLabel: Englischer Kanalname
Comments: Kommentare
CommentsHint: Weitere Kommentare, die du uns mitteilen möchtest.
VtuberRequirementText: >-
Für Unabhängige sind mindestens 20K Abonnenten erforderlich. VTuber werden als Teil der bestehenden Orgs akzeptiert. <br /><br />Neue Orgs werden nach Abonnentenzahlen erstellt.
ClipperRequirementText: >-
Clipper-Kanäle müssen mindestens 2 Monate alt sein und regelmäßig bzw. mehr als 20 Clips in einem Monat hochladen. Das Spammen von kurzen täglichen Clips, das Hochladen ausschließlich kurzer &lt;1min Clips oder das Benutzen von unschmeichelhaften Thumbnails zählen alle gegen den Kanal. Auch die Qualität der Inhalte kann beurteilt werden. <br /><br />Es ist wichtig zu beachten, dass Clipper ihre Quellen über Kanallinks, @YouTube-Kanalerwähnungen und Video-Links angeben sollten. Überzitierung (z.B. alle Nijisanji-Mitglieder verlinken) schafft Arbeit für Holodex-Editoren, und Unterzitieren (keine Links) versteckt Clips. <br /><br /> Holodex nutzt Algorithmen, um Überzitierungen zu erkennen und automatisch zu korrigieren, aber diese funktionieren möglicherweise nicht immer perfekt. Clipper, die häufig überzitieren, können dafür von der Plattform entfernt werden.
DeletionRequirementText: >-
Löschung sollte nur angefragt werden, wenn du/ihr der/die Kanalbesitzer bist/seid. Bitte gib Kontaktinformationen an, damit wir dies überprüfen können.
PageTitle: Holodex Kanalanfrage
ChannelURLErrorFeedback: Muss https://www.youtube.com/channel/UC_____ sein
2 changes: 2 additions & 0 deletions src/locales/es-ES/seo.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
music:
title: 'Canciones originales y covers de {{english_name}} - Holodex'
description: >-
Escucha la música oficial y los streams de karaoke marcados por nuestra comunidad usando el Reproductor de Música de Holodex.
3 changes: 0 additions & 3 deletions src/locales/es-MX/ui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -628,11 +628,8 @@ channelRequest:
EnglishNameLabel: Nombre del canal en Inglés
Comments: Comentarios
CommentsHint: Otros comentarios que te gustaría decirnos.
VtuberRequirementText: >-
Se requiere un mínimo de 20K de suscriptores para independientes. Vtubers que son parte de organizaciones existentes serán aceptadas. <br /><br />Organizaciones nuevas serán creadas dependiendo de el conteo promedio de suscriptores.
ClipperRequirementText: >-
Para los clippers, debe ser de al menos 2 meses de antigüedad y publicar regularmente, o publicar más de 20 clips en un mes. El spam de clips cortos diariamente, publicar solamente clips cortos de &lt;1min, o usar miniaturas poco favorecedoras contarán contra el canal. La calidad del contenido podría ser juzgada también. <br /><br />Es importante saber que los clippers deberían citar las fuentes vía enlaces de youtube, menciones de canales de @Youtube, y enlaces de videos. Citar de más (por ejemplo enlazar a todos en Nijisanji) crea trabajo para los editores de Holodex, y citar menos (sin enlaces) hará los clips ocultos. <br /><br /> Holodex contiene algoritmos para detectar las citas de más y corregirlas automáticamente, pero puede no funcionar perfectamente. Los clippers que citen podrían ser removidos de la plataforma para reducir el ruido.
DeletionRequirementText: >-
La eliminación solo debería ser solicitada si eres el dueño(s) del canal, por favor provee información de contacto para que podamos verificar esto.
PageTitle: Petición de canal de Holodex
ChannelURLErrorFeedback: "Debe ser\nhttps://www.youtube.com/channel/UC_____"
Loading

0 comments on commit fd849ea

Please sign in to comment.