Skip to content

Commit

Permalink
[feat] Language development.
Browse files Browse the repository at this point in the history
  • Loading branch information
yasgo committed Sep 4, 2024
1 parent 729493c commit a858b84
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 8 deletions.
8 changes: 8 additions & 0 deletions _locales/en/messages.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": {
"message": "Youtube Popularity Score"
},
"description": {
"message": "A plugin that rates the popularity of YouTube videos."
}
}
8 changes: 8 additions & 0 deletions _locales/tr/messages.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": {
"message": "Youtube Popularity Score"
},
"description": {
"message": "YouTube videolarının popülerliğini derecelendiren bir eklenti."
}
}
6 changes: 1 addition & 5 deletions content.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,18 +227,14 @@ const popularVideoDetect = {
const videoElements = document.querySelectorAll("ytd-rich-item-renderer");

videoElements.forEach((videoElement) => {
if (videoElement.getAttribute("data-processed")) return;
if (videoElement.getAttribute("data-processed") || !videoElement) return;

const hasElement =
popularVideoDetect.tools.isNotEmptyElement(videoElement);

if (hasElement) {
const info = popularVideoDetect.getVideoInfo(videoElement);

if (!info.uploadDate?.date) {
console.log("info: ", info);
}

const popularityScore =
popularVideoDetect.tools.calculatePopularityScore(
info.uploadDate.date,
Expand Down
7 changes: 4 additions & 3 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"manifest_version": 3,
"name": "Youtube Popularity Score",
"description": "A plugin that rates the popularity of YouTube videos.",
"version": "0.0.2",
"name": "__MSG_name__",
"description": "__MSG_description__",
"version": "0.1.2",
"default_locale": "tr",
"background": {
"service_worker": "background.js"
},
Expand Down

0 comments on commit a858b84

Please sign in to comment.