update
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
const SERVER_URL = "http://marha.local:8000/videos";
|
||||
const SERVER_BASE = "http://marha.local:8000";
|
||||
|
||||
browser.runtime.onMessage.addListener((video) => {
|
||||
fetch(SERVER_URL, {
|
||||
browser.runtime.onMessage.addListener(({ profileId, video }) => {
|
||||
fetch(`${SERVER_BASE}/profiles/${profileId}/videos`, {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify(video),
|
||||
|
||||
@@ -25,10 +25,9 @@ function extractVideoFromCard(element) {
|
||||
|
||||
async function sendVideo(video) {
|
||||
const stored = await browser.storage.local.get("profileId");
|
||||
const profileId = stored.profileId || null;
|
||||
const payload = { ...video, profileId };
|
||||
console.log(`[YT-Erfasser] Video senden (Profil: ${profileId})`, payload.title);
|
||||
browser.runtime.sendMessage(payload);
|
||||
const profileId = stored.profileId || 1;
|
||||
console.log(`[YT-Erfasser] Video senden (Profil: ${profileId})`, video.title);
|
||||
browser.runtime.sendMessage({ profileId, video });
|
||||
}
|
||||
|
||||
// --- IntersectionObserver: nur sichtbare Cards erfassen ---
|
||||
|
||||
Reference in New Issue
Block a user