Skip to content

Commit

Permalink
Merge pull request #722 from HolodexNet/dev
Browse files Browse the repository at this point in the history
2.36 Release
  • Loading branch information
sphinxrave authored Aug 13, 2023
2 parents f86c0c8 + 1c49736 commit 785c63b
Show file tree
Hide file tree
Showing 18 changed files with 421 additions and 90 deletions.
6 changes: 6 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
- Development of Vue3-powered Holodex (release 3.0 ?!?!) is underway... If you like to influence how it looks, now is the best time to let us know.
- If you are a UI engineer and would like to contribute to Holodex, drop by the discord!

### 2.36 Holodex [*August 12th, 2023*]

- We got audited, yay.
- We updated our privacy policy on the About Page.
- Youtube icon sizes have been adjusted to satisfy guidelines posted on [Youtube Brand Resources](https://www.youtube.com/howyoutubeworks/resources/brand-resources/#logos-icons-and-colors)

### 2.35 Holodex [*July 8th, 2023*]

- I think twitter broke the timeline embed. This is entirely twitter's fault this time. Hmph!
Expand Down
12 changes: 6 additions & 6 deletions src/components/channel/ChannelSocials.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@
<v-btn
v-if="channel.id && !hideYt"
icon
sm
large
:href="`https://www.youtube.com/channel/${channel.id}`"
rel="noreferrer"
target="_blank"
>
<v-icon color="#C4302B">
<v-icon color="#FF0000" size="36px">
{{ icons.mdiYoutube }}
</v-icon>
</v-btn>
<v-btn
v-if="channel.twitter && !hideTwitter"
icon
sm
large
:href="`https://twitter.com/${channel.twitter}`"
rel="noreferrer"
target="_blank"
Expand All @@ -28,7 +28,7 @@
<v-btn
v-if="channel.twitch && !hideTwitch"
icon
sm
large
:href="`https://twitch.tv/${channel.twitch}`"
rel="noreferrer"
target="_blank"
Expand All @@ -41,7 +41,7 @@
<template #activator="{ on, attrs }">
<v-btn
icon
sm
large
v-bind="attrs"
@click.stop="toggleFavorite($event)"
v-on="on"
Expand Down Expand Up @@ -122,7 +122,7 @@ export default {
return {
mdiAccountCancel,
mdiHeartOutline,
mdiTwitch
mdiTwitch,
};
},
computed: {
Expand Down
2 changes: 1 addition & 1 deletion src/components/edit/VideoEditSongs.vue
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@
</v-row>
<v-row dense>
<v-col cols="12">
<v-list style="min-height: 30vh">
<v-list style="min-height: 30vh; max-height: 45vh; overflow-y:auto">
<template v-for="song in songList">
<song-item
:key="song.name"
Expand Down
84 changes: 69 additions & 15 deletions src/components/media/CommentSongParser.vue
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,13 @@ export default {
const resEn = await this.searchAutocomplete(query, "en_us");
const lookupEn = resEn.results || [];
console.log(lookupEn);
const fnLookupFn = (id, name) => {
const fnLookupFn = (id, name, altName) => {
const foundEn = lookupEn.find((x) => x.trackId === id);
if (foundEn && foundEn.trackName !== name && compareTwoStrings(foundEn.trackName, name) < 0.2) {
return `${name} / ${foundEn.trackName}`;
const possibleNames = [foundEn.trackCensoredName?.toUpperCase(), foundEn.trackName.toUpperCase()];
if (foundEn && !possibleNames.includes(name.toUpperCase()) && compareTwoStrings(foundEn.trackName, name) < 0.75) {
return `${name} / ${foundEn.trackCensoredName || foundEn.trackName}`;
}
return name;
return altName || name;
};
if (res && res.results) {
// console.log(res.results);
Expand All @@ -152,6 +153,7 @@ export default {
releaseDate,
artistName,
trackName,
trackCensoredName,
trackTimeMillis,
artworkUrl100,
trackViewUrl,
Expand All @@ -161,7 +163,7 @@ export default {
collectionName,
releaseDate,
artistName,
trackName: fnLookupFn(trackId, trackName),
trackName: fnLookupFn(trackId, trackName, trackCensoredName),
artworkUrl100,
trackViewUrl,
}),
Expand All @@ -174,15 +176,67 @@ export default {
async searchMusicdex(query) {
try {
const resp = await axiosInstance({ url: "https://staging.holodex.net/api/v2/musicdex/search", method: "POST", data: { q: query } });
return resp?.data?.hits?.map(({ document }) => ({
trackId: document.itunesid,
artistName: document.original_artist,
trackName: document.name,
trackTimeMillis: (document.end - document.start) * 1000,
trackViewUrl: document.amUrl,
artworkUrl100: document.art,
})) || [];
const resp = await axiosInstance({
url: "/musicdex/elasticsearch/search",
method: "POST",
headers: {
"Content-Type": "application/x-ndjson",
Accept: "application/json, text/plain, */*",
},
data:
`{"preference":"results"}\n${
JSON.stringify({
query: {
bool: {
must: [
{
bool: {
must: [
{
multi_match: {
query,
fields: [
"general^3",
"general.romaji^0.5",
"original_artist^2",
"original_artist.romaji^0.5",
],
type: "most_fields",
},
},
{
multi_match: {
query,
fields: [
"name.ngram",
"name",
],
type: "most_fields",
},
},
],
},
},
],
},
},
size: 12,
_source: { includes: ["*"], excludes: [] },
from: 0,
sort: [{ _score: { order: "desc" } }],
})}\n`,
});
return (
resp?.data?.responses?.[0]?.hits?.hits?.map(({ _source }) => ({
trackId: _source.itunesid,
artistName: _source.original_artist,
trackName: _source.name,
trackTimeMillis: (_source.end - _source.start) * 1000,
trackViewUrl: _source.amUrl,
artworkUrl100: _source.art,
src: "Musicdex",
})) || []
);
} catch (e) {
console.error(e);
return [];
Expand All @@ -199,7 +253,7 @@ export default {
});
},
async tryLooking({ index, start_time, end_time, tokens }, token, idx) {
async tryLooking({ /* index, */ start_time, end_time, tokens }, token, idx) {
console.log(tokens);
// const nonSplit = tokens;
Expand Down
Loading

0 comments on commit 785c63b

Please sign in to comment.