-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Rémi Rigal
committed
Apr 14, 2022
1 parent
086b959
commit 485a2f4
Showing
2 changed files
with
40 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
let overseerrContainer, tmdbId, mediaType, mediaInfo; | ||
|
||
containerOptions.anchorElement = `div.review.body-text`; | ||
containerOptions.containerClass = 'py-2'; | ||
containerOptions.plexButtonClass = 'bg-gray-800'; | ||
containerOptions.badgeBackground = '#283038'; | ||
|
||
mediaType = 'movie'; | ||
|
||
tmdbButton = $('a[data-track-action=TMDb]:first'); | ||
tmdbURL = tmdbButton.attr('href'); | ||
|
||
const tmdbRegex = /.*\/movie\/(\d+)(?:\w|-)*/; | ||
let matches = tmdbURL.match(tmdbRegex); | ||
if (matches !== null && matches.length > 1) { | ||
tmdbId = parseInt(matches[1]); | ||
console.log(`TMDB id: ${tmdbId}`); | ||
|
||
initializeContainer(); | ||
insertSpinner(); | ||
|
||
pullStoredData(function() { | ||
if (!userId) { | ||
removeSpinner(); | ||
insertNotLoggedInButton(); | ||
return; | ||
} | ||
chrome.runtime.sendMessage({contentScriptQuery: 'queryMedia', tmdbId: tmdbId, mediaType: mediaType}, json => { | ||
mediaInfo = json; | ||
removeSpinner(); | ||
fillContainer(json.mediaInfo); | ||
}); | ||
}); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters