Git Komut Rehberi & Terminal Asistanı
Sıfırdan Yeni Bir Depo Başlatın:
Mevcut Bir Git Deposu veya Klasörü Gönderin:
Hataları Geri Alma, İptal & Temizlik:
Son commit'i geri al (yapılan değişiklikleri korur):
git reset --soft HEAD~1
Yapılan yerel değişiklikleri iptal et (çalışma ağacını temizler):
git restore .
Takip edilmeyen gereksiz dosyaları sil:
git clean -fd
Değişiklikleri geçici sakla ve geri getir (stash):
git stash git stash pop
Dal (Branch) ve Sürüm Etiketleri:
Yeni dal aç ve geçiş yap:
git checkout -b yeni-ozellik git push -u origin yeni-ozellik
Sürüm etiketi (tag) oluştur ve gönder:
git tag -a v1.0.0 -m "Sürüm 1.0.0" git push origin --tags
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a67bb3339e | ||
|
|
b952663f3a | ||
|
|
0c98d079be | ||
|
|
0bf905f81f |
@@ -0,0 +1,4 @@
|
|||||||
|
node_modules/
|
||||||
|
dist/
|
||||||
|
package-lock.json
|
||||||
|
pnpm-lock.yaml
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"semi": true,
|
||||||
|
"singleQuote": true,
|
||||||
|
"tabWidth": 2,
|
||||||
|
"trailingComma": "none",
|
||||||
|
"printWidth": 120,
|
||||||
|
"arrowParens": "avoid",
|
||||||
|
"endOfLine": "auto"
|
||||||
|
}
|
||||||
@@ -1,48 +1,47 @@
|
|||||||
|
// 100% Incompatible Browser Suppression & Error Guardian
|
||||||
// 100% Incompatible Browser Suppression & Error Guardian
|
// CRITICAL: PeerTube's Angular app (my-app ngOnInit) relies on document.getElementById('incompatible-browser')
|
||||||
// CRITICAL: PeerTube's Angular app (my-app ngOnInit) relies on document.getElementById('incompatible-browser')
|
// to exist so it can do .className += " browser-ok" before calling this.loadUser()!
|
||||||
// to exist so it can do .className += " browser-ok" before calling this.loadUser()!
|
// Removing it from DOM causes a null pointer crash that breaks user session initialization!
|
||||||
// Removing it from DOM causes a null pointer crash that breaks user session initialization!
|
if (typeof window !== 'undefined') {
|
||||||
if (typeof window !== 'undefined') {
|
try {
|
||||||
try {
|
window.displayIncompatibleBrowser = function () {};
|
||||||
window.displayIncompatibleBrowser = function () {};
|
var neuterIncompatible = function () {
|
||||||
var neuterIncompatible = function () {
|
var el = document.getElementById('incompatible-browser');
|
||||||
var el = document.getElementById('incompatible-browser');
|
if (el) {
|
||||||
if (el) {
|
if (!el.classList.contains('browser-ok')) {
|
||||||
if (!el.classList.contains('browser-ok')) {
|
el.classList.add('browser-ok');
|
||||||
el.classList.add('browser-ok');
|
|
||||||
}
|
|
||||||
el.style.setProperty('display', 'none', 'important');
|
|
||||||
el.style.setProperty('visibility', 'hidden', 'important');
|
|
||||||
el.style.setProperty('height', '0px', 'important');
|
|
||||||
el.style.setProperty('width', '0px', 'important');
|
|
||||||
el.style.setProperty('opacity', '0', 'important');
|
|
||||||
el.style.setProperty('pointer-events', 'none', 'important');
|
|
||||||
} else {
|
|
||||||
try {
|
|
||||||
var dummy = document.createElement('div');
|
|
||||||
dummy.id = 'incompatible-browser';
|
|
||||||
dummy.className = 'browser-ok';
|
|
||||||
dummy.style.display = 'none';
|
|
||||||
(document.body || document.documentElement).appendChild(dummy);
|
|
||||||
} catch (e) {}
|
|
||||||
}
|
}
|
||||||
};
|
el.style.setProperty('display', 'none', 'important');
|
||||||
neuterIncompatible();
|
el.style.setProperty('visibility', 'hidden', 'important');
|
||||||
if (document.readyState === 'loading') {
|
el.style.setProperty('height', '0px', 'important');
|
||||||
document.addEventListener('DOMContentLoaded', neuterIncompatible);
|
el.style.setProperty('width', '0px', 'important');
|
||||||
|
el.style.setProperty('opacity', '0', 'important');
|
||||||
|
el.style.setProperty('pointer-events', 'none', 'important');
|
||||||
|
} else {
|
||||||
|
try {
|
||||||
|
var dummy = document.createElement('div');
|
||||||
|
dummy.id = 'incompatible-browser';
|
||||||
|
dummy.className = 'browser-ok';
|
||||||
|
dummy.style.display = 'none';
|
||||||
|
(document.body || document.documentElement).appendChild(dummy);
|
||||||
|
} catch (e) {}
|
||||||
}
|
}
|
||||||
setInterval(neuterIncompatible, 1000);
|
};
|
||||||
} catch (e) {}
|
neuterIncompatible();
|
||||||
}
|
if (document.readyState === 'loading') {
|
||||||
|
document.addEventListener('DOMContentLoaded', neuterIncompatible);
|
||||||
// Immediate URL rewrite: redirect legacy /search/videos to /search
|
|
||||||
if (typeof window !== 'undefined' && window.location) {
|
|
||||||
if (window.location.pathname === '/search/videos' || window.location.pathname.startsWith('/search/videos/')) {
|
|
||||||
var targetSearch = window.location.search || '';
|
|
||||||
window.location.replace('/search' + targetSearch);
|
|
||||||
}
|
}
|
||||||
|
setInterval(neuterIncompatible, 1000);
|
||||||
|
} catch (e) {}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Immediate URL rewrite: redirect legacy /search/videos to /search
|
||||||
|
if (typeof window !== 'undefined' && window.location) {
|
||||||
|
if (window.location.pathname === '/search/videos' || window.location.pathname.startsWith('/search/videos/')) {
|
||||||
|
var targetSearch = window.location.search || '';
|
||||||
|
window.location.replace('/search' + targetSearch);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
(function () {
|
(function () {
|
||||||
if (window.__YAKTUBE_ENGINE_LOADED__) return;
|
if (window.__YAKTUBE_ENGINE_LOADED__) return;
|
||||||
@@ -172,10 +171,7 @@ try {
|
|||||||
var hasToken = localStorage.getItem('access_token') || localStorage.getItem('username');
|
var hasToken = localStorage.getItem('access_token') || localStorage.getItem('username');
|
||||||
if (hasToken) {
|
if (hasToken) {
|
||||||
console.log('[YakTube] YakNet session ended elsewhere. Clearing YakTube...');
|
console.log('[YakTube] YakNet session ended elsewhere. Clearing YakTube...');
|
||||||
try {
|
clearYakTubeAuthSession();
|
||||||
localStorage.clear();
|
|
||||||
sessionStorage.clear();
|
|
||||||
} catch (e) {}
|
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -198,20 +194,32 @@ try {
|
|||||||
} else if (e.detail && e.detail.authenticated === false) {
|
} else if (e.detail && e.detail.authenticated === false) {
|
||||||
var hasToken = localStorage.getItem('access_token') || localStorage.getItem('username');
|
var hasToken = localStorage.getItem('access_token') || localStorage.getItem('username');
|
||||||
if (hasToken) {
|
if (hasToken) {
|
||||||
try {
|
clearYakTubeAuthSession();
|
||||||
localStorage.clear();
|
|
||||||
sessionStorage.clear();
|
|
||||||
} catch (err) {}
|
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Clear YakTube auth session and cloud search cache safely
|
||||||
|
function clearYakTubeAuthSession() {
|
||||||
|
try {
|
||||||
|
localStorage.removeItem('access_token');
|
||||||
|
localStorage.removeItem('refresh_token');
|
||||||
|
localStorage.removeItem('token_type');
|
||||||
|
localStorage.removeItem('id');
|
||||||
|
localStorage.removeItem('username');
|
||||||
|
localStorage.removeItem('displayName');
|
||||||
|
localStorage.removeItem('email');
|
||||||
|
localStorage.removeItem('role');
|
||||||
|
localStorage.removeItem('yaktube_recent_searches');
|
||||||
|
sessionStorage.clear();
|
||||||
|
} catch (e) {}
|
||||||
|
}
|
||||||
|
|
||||||
// Unified single sign-out for YakTube and YakNet
|
// Unified single sign-out for YakTube and YakNet
|
||||||
function performUnifiedLogout() {
|
function performUnifiedLogout() {
|
||||||
|
clearYakTubeAuthSession();
|
||||||
try {
|
try {
|
||||||
localStorage.clear();
|
|
||||||
sessionStorage.clear();
|
|
||||||
sessionStorage.setItem('yaknet_manual_logout', 'true');
|
sessionStorage.setItem('yaknet_manual_logout', 'true');
|
||||||
} catch (err) {}
|
} catch (err) {}
|
||||||
window.location.replace(
|
window.location.replace(
|
||||||
@@ -1685,14 +1693,16 @@ try {
|
|||||||
// Clean up stray 404 error mascot pages if on search
|
// Clean up stray 404 error mascot pages if on search
|
||||||
try {
|
try {
|
||||||
var errPages = document.querySelectorAll('my-error-page');
|
var errPages = document.querySelectorAll('my-error-page');
|
||||||
errPages.forEach(function(ep) { ep.remove(); });
|
errPages.forEach(function (ep) {
|
||||||
|
ep.remove();
|
||||||
|
});
|
||||||
} catch (e) {}
|
} catch (e) {}
|
||||||
|
|
||||||
// Instant URL fixer: redirect legacy /search/videos to native /search
|
// Instant URL fixer: redirect legacy /search/videos to native /search
|
||||||
if (window.location.pathname === '/search/videos' || window.location.pathname.startsWith('/search/videos/')) {
|
if (window.location.pathname === '/search/videos' || window.location.pathname.startsWith('/search/videos/')) {
|
||||||
window.location.replace('/search' + window.location.search);
|
window.location.replace('/search' + window.location.search);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var url = new URL(window.location.href);
|
var url = new URL(window.location.href);
|
||||||
var searchParam = url.searchParams.get('search');
|
var searchParam = url.searchParams.get('search');
|
||||||
@@ -2005,37 +2015,79 @@ try {
|
|||||||
} catch (e) {}
|
} catch (e) {}
|
||||||
// Default initial recent searches for first-time visitors
|
// Default initial recent searches for first-time visitors
|
||||||
var defaults = ['Tarkan', 'Barış Manço', 'Yapay Zeka', 'Canlı Haber'];
|
var defaults = ['Tarkan', 'Barış Manço', 'Yapay Zeka', 'Canlı Haber'];
|
||||||
try {
|
if (!isUserLoggedIn()) {
|
||||||
localStorage.setItem('yaktube_recent_searches', JSON.stringify(defaults));
|
try {
|
||||||
} catch (e) {}
|
localStorage.setItem('yaktube_recent_searches', JSON.stringify(defaults));
|
||||||
|
} catch (e) {}
|
||||||
|
}
|
||||||
return defaults;
|
return defaults;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function callCloudSearchHistory(method, queryParams, body, onSuccess, onError) {
|
||||||
|
var token = localStorage.getItem('access_token');
|
||||||
|
var email = localStorage.getItem('email');
|
||||||
|
var username = localStorage.getItem('username');
|
||||||
|
var headers = {};
|
||||||
|
if (body) headers['Content-Type'] = 'application/json';
|
||||||
|
if (token) headers['Authorization'] = 'Bearer ' + token;
|
||||||
|
if (email) headers['X-User-Email'] = email;
|
||||||
|
if (username) headers['X-User-Username'] = username;
|
||||||
|
|
||||||
|
var authUrl = 'https://auth.yakhub.com.tr/api/yaktube/search-history' + (queryParams || '');
|
||||||
|
var bridgeUrl = '/api-custom/search-history' + (queryParams || '');
|
||||||
|
|
||||||
|
var options = {
|
||||||
|
method: method,
|
||||||
|
headers: headers,
|
||||||
|
credentials: 'include'
|
||||||
|
};
|
||||||
|
if (body) options.body = JSON.stringify(body);
|
||||||
|
|
||||||
|
fetch(authUrl, options)
|
||||||
|
.then(function (res) {
|
||||||
|
if (!res.ok) throw new Error('Auth server status ' + res.status);
|
||||||
|
return res.json();
|
||||||
|
})
|
||||||
|
.then(function (data) {
|
||||||
|
if (typeof onSuccess === 'function') onSuccess(data);
|
||||||
|
})
|
||||||
|
.catch(function () {
|
||||||
|
// Fallback to local PeerTube bridge proxy
|
||||||
|
fetch(bridgeUrl, options)
|
||||||
|
.then(function (res) {
|
||||||
|
return res.json();
|
||||||
|
})
|
||||||
|
.then(function (data) {
|
||||||
|
if (typeof onSuccess === 'function') onSuccess(data);
|
||||||
|
})
|
||||||
|
.catch(function (e) {
|
||||||
|
if (typeof onError === 'function') onError(e);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
var isSyncingHistory = false;
|
var isSyncingHistory = false;
|
||||||
function syncCloudSearchHistory(callback) {
|
function syncCloudSearchHistory(callback) {
|
||||||
if (!isAccountSyncEnabled() || isSyncingHistory) return;
|
if (!isAccountSyncEnabled() || isSyncingHistory) return;
|
||||||
isSyncingHistory = true;
|
isSyncingHistory = true;
|
||||||
|
|
||||||
var token = localStorage.getItem('access_token');
|
callCloudSearchHistory(
|
||||||
var headers = {};
|
'GET',
|
||||||
if (token) headers['Authorization'] = 'Bearer ' + token;
|
'',
|
||||||
|
null,
|
||||||
fetch('/api-custom/search-history', {
|
function (data) {
|
||||||
method: 'GET',
|
|
||||||
headers: headers,
|
|
||||||
credentials: 'include'
|
|
||||||
})
|
|
||||||
.then(function (res) { return res.json(); })
|
|
||||||
.then(function (data) {
|
|
||||||
isSyncingHistory = false;
|
isSyncingHistory = false;
|
||||||
if (data && data.status === 'success' && Array.isArray(data.history) && data.history.length > 0) {
|
if (data && data.status === 'success' && Array.isArray(data.history)) {
|
||||||
localStorage.setItem('yaktube_recent_searches', JSON.stringify(data.history));
|
if (data.history.length > 0) {
|
||||||
|
localStorage.setItem('yaktube_recent_searches', JSON.stringify(data.history));
|
||||||
|
}
|
||||||
if (typeof callback === 'function') callback();
|
if (typeof callback === 'function') callback();
|
||||||
}
|
}
|
||||||
})
|
},
|
||||||
.catch(function () {
|
function () {
|
||||||
isSyncingHistory = false;
|
isSyncingHistory = false;
|
||||||
});
|
}
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function saveRecentSearch(query) {
|
function saveRecentSearch(query) {
|
||||||
@@ -2053,16 +2105,7 @@ try {
|
|||||||
|
|
||||||
// If user is logged in and sync is active, sync with YakNet account
|
// If user is logged in and sync is active, sync with YakNet account
|
||||||
if (isAccountSyncEnabled()) {
|
if (isAccountSyncEnabled()) {
|
||||||
var token = localStorage.getItem('access_token');
|
callCloudSearchHistory('POST', '', { query: q, device_name: 'YakTube Web' });
|
||||||
var headers = { 'Content-Type': 'application/json' };
|
|
||||||
if (token) headers['Authorization'] = 'Bearer ' + token;
|
|
||||||
|
|
||||||
fetch('/api-custom/search-history', {
|
|
||||||
method: 'POST',
|
|
||||||
headers: headers,
|
|
||||||
credentials: 'include',
|
|
||||||
body: JSON.stringify({ query: q })
|
|
||||||
}).catch(function () {});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2072,15 +2115,7 @@ try {
|
|||||||
} catch (e) {}
|
} catch (e) {}
|
||||||
|
|
||||||
if (isAccountSyncEnabled()) {
|
if (isAccountSyncEnabled()) {
|
||||||
var token = localStorage.getItem('access_token');
|
callCloudSearchHistory('DELETE', '', null);
|
||||||
var headers = { 'Content-Type': 'application/json' };
|
|
||||||
if (token) headers['Authorization'] = 'Bearer ' + token;
|
|
||||||
|
|
||||||
fetch('/api-custom/search-history', {
|
|
||||||
method: 'DELETE',
|
|
||||||
headers: headers,
|
|
||||||
credentials: 'include'
|
|
||||||
}).catch(function () {});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
renderDynamicSearchChips();
|
renderDynamicSearchChips();
|
||||||
@@ -2611,6 +2646,13 @@ try {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Automatically trigger cloud search history pull on startup if logged in
|
||||||
|
try {
|
||||||
|
if (isAccountSyncEnabled()) {
|
||||||
|
syncCloudSearchHistory();
|
||||||
|
}
|
||||||
|
} catch (e) {}
|
||||||
|
|
||||||
// 7.5. Reactive Hybrid Related Videos Engine (Watch Page)
|
// 7.5. Reactive Hybrid Related Videos Engine (Watch Page)
|
||||||
var currentActiveVideoKey = null;
|
var currentActiveVideoKey = null;
|
||||||
var isFetchingRelated = false;
|
var isFetchingRelated = false;
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "peertube-plugin-yaktube-ondemand",
|
"name": "peertube-plugin-yaktube-ondemand",
|
||||||
"version": "1.4.25",
|
"version": "1.4.28",
|
||||||
"description": "Accessible On-Demand YouTube Import, Live Streams, Smart Recommendations and A11y Engine for PeerTube",
|
"description": "Accessible On-Demand YouTube Import, Live Streams, Smart Recommendations and A11y Engine for PeerTube",
|
||||||
"main": "main.js",
|
"main": "main.js",
|
||||||
"library": "./main.js",
|
"library": "./main.js",
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/* 100% Elimination of PeerTube Mobile Open-in-App & Incompatible Browser Banners */
|
/* 100% Elimination of PeerTube Mobile Open-in-App & Incompatible Browser Banners */
|
||||||
#incompatible-browser,
|
#incompatible-browser,
|
||||||
.alert-light#incompatible-browser,
|
.alert-light#incompatible-browser,
|
||||||
div[id="incompatible-browser"],
|
div[id='incompatible-browser'],
|
||||||
.incompatible-browser,
|
.incompatible-browser,
|
||||||
.mobile-msg,
|
.mobile-msg,
|
||||||
my-header .mobile-msg,
|
my-header .mobile-msg,
|
||||||
@@ -947,7 +947,6 @@ body.yaktube-theater-mode .video-js {
|
|||||||
outline: none !important;
|
outline: none !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Suppress 404 Mascot and Error Page on Search results */
|
/* Suppress 404 Mascot and Error Page on Search results */
|
||||||
body:has(#yaktube-ondemand-container) my-error-page,
|
body:has(#yaktube-ondemand-container) my-error-page,
|
||||||
#yaktube-ondemand-container ~ my-error-page,
|
#yaktube-ondemand-container ~ my-error-page,
|
||||||
|
|||||||
Reference in New Issue
Block a user