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 | |
|---|---|---|---|
|
|
b5ebb1d19c | ||
|
|
723c827e2a | ||
|
|
14bae6d365 | ||
|
|
116f8acfe6 |
@@ -4354,20 +4354,54 @@ try {
|
||||
var q = query.trim();
|
||||
try {
|
||||
var list = getRecentSearches();
|
||||
// Remove previous occurrence of the exact term (case-insensitive) and bubble it to the very top (#1)
|
||||
list = list.filter(function (item) {
|
||||
return item.toLowerCase() !== q.toLowerCase();
|
||||
});
|
||||
list.unshift(q);
|
||||
if (list.length > 12) list = list.slice(0, 12);
|
||||
if (list.length > 20) list = list.slice(0, 20);
|
||||
localStorage.setItem('yaktube_recent_searches', JSON.stringify(list));
|
||||
} catch (e) {}
|
||||
|
||||
// If user is logged in and sync is active, sync with YakNet account
|
||||
if (isAccountSyncEnabled()) {
|
||||
callCloudSearchHistory('POST', '', { query: q, device_name: 'YakTube Web' });
|
||||
callCloudSearchHistory('POST', '', { query: q, device_name: 'YakTube Web' }, function (data) {
|
||||
if (data && data.status === 'success' && Array.isArray(data.history) && data.history.length > 0) {
|
||||
localStorage.setItem('yaktube_recent_searches', JSON.stringify(data.history));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function deleteRecentSearch(targetQuery) {
|
||||
if (!targetQuery) return;
|
||||
var q = targetQuery.trim();
|
||||
try {
|
||||
var list = getRecentSearches();
|
||||
list = list.filter(function (item) {
|
||||
return item.toLowerCase() !== q.toLowerCase();
|
||||
});
|
||||
localStorage.setItem('yaktube_recent_searches', JSON.stringify(list));
|
||||
} catch (e) {}
|
||||
|
||||
if (isAccountSyncEnabled()) {
|
||||
callCloudSearchHistory('DELETE', '?query=' + encodeURIComponent(q), { query: q }, function (data) {
|
||||
if (data && data.status === 'success' && Array.isArray(data.history)) {
|
||||
localStorage.setItem('yaktube_recent_searches', JSON.stringify(data.history));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
var modal = document.getElementById('yaktube-full-search-modal');
|
||||
var filterVal = '';
|
||||
if (modal) {
|
||||
var inp = modal.querySelector('#yaktube-modal-input');
|
||||
if (inp) filterVal = inp.value;
|
||||
}
|
||||
renderDynamicSearchChips(filterVal);
|
||||
announce('"' + q + '" araması geçmişten silindi.');
|
||||
}
|
||||
|
||||
function clearRecentSearches() {
|
||||
try {
|
||||
localStorage.removeItem('yaktube_recent_searches');
|
||||
@@ -4406,7 +4440,7 @@ try {
|
||||
captureUrlSearchQuery();
|
||||
window.addEventListener('popstate', captureUrlSearchQuery);
|
||||
|
||||
function renderDynamicSearchChips() {
|
||||
function renderDynamicSearchChips(filterText) {
|
||||
var modal = document.getElementById('yaktube-full-search-modal');
|
||||
if (!modal) return;
|
||||
|
||||
@@ -4416,12 +4450,28 @@ try {
|
||||
var recent = getRecentSearches();
|
||||
var loggedIn = isUserLoggedIn();
|
||||
var syncEnabled = isAccountSyncEnabled();
|
||||
var filter = (filterText || '').trim().toLowerCase();
|
||||
|
||||
var displayedRecent = recent;
|
||||
var displayedPopular = popularTrendingQueries;
|
||||
|
||||
if (filter.length > 0) {
|
||||
displayedRecent = recent.filter(function (term) {
|
||||
return term.toLowerCase().includes(filter);
|
||||
});
|
||||
displayedPopular = popularTrendingQueries.filter(function (item) {
|
||||
return item.q.toLowerCase().includes(filter) || item.title.toLowerCase().includes(filter);
|
||||
});
|
||||
}
|
||||
|
||||
var html = '';
|
||||
|
||||
// 1. Recent searches section
|
||||
html +=
|
||||
'<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; flex-wrap: wrap; gap: 8px;">' +
|
||||
'<div class="yaktube-modal-section-title" style="margin-bottom: 0;">🕒 Son Aramalarınız</div>' +
|
||||
'<div class="yaktube-modal-section-title" style="margin-bottom: 0;">🕒 ' +
|
||||
(filter.length > 0 ? 'Eşleşen Son Aramalarınız' : 'Son Aramalarınız') +
|
||||
'</div>' +
|
||||
'<div style="display: flex; align-items: center; gap: 8px;">';
|
||||
|
||||
if (loggedIn) {
|
||||
@@ -4448,52 +4498,82 @@ try {
|
||||
'<span style="font-size: 11px; color: #94a3b8; background: #1e293b; border-radius: 6px; padding: 2px 8px;" title="Misafir modundasınız, aramalar sadece bu cihazda saklanır">🔒 Bu Cihazda</span>';
|
||||
}
|
||||
|
||||
if (recent.length > 0) {
|
||||
if (recent.length > 0 && filter.length === 0) {
|
||||
html +=
|
||||
'<button id="yaktube-clear-recent-btn" style="background: transparent; border: none; color: #ff8f37; font-size: 12px; font-weight: 600; cursor: pointer; text-decoration: underline;" aria-label="Arama geçmişini temizle">Geçmişi Temizle</button>';
|
||||
'<button id="yaktube-clear-recent-btn" style="background: transparent; border: none; color: #ff8f37; font-size: 12px; font-weight: 600; cursor: pointer; text-decoration: underline;" aria-label="Tüm arama geçmişini temizle">Geçmişi Temizle</button>';
|
||||
}
|
||||
|
||||
html += '</div></div>';
|
||||
|
||||
if (recent.length > 0) {
|
||||
if (displayedRecent.length > 0) {
|
||||
html += '<div class="yaktube-modal-chips-grid" style="margin-bottom: 18px;">';
|
||||
recent.forEach(function (term) {
|
||||
displayedRecent.forEach(function (term) {
|
||||
var safeTerm = term.replace(/"/g, '"');
|
||||
html +=
|
||||
'<button class="yaktube-modal-chip yaktube-recent-chip" data-query="' +
|
||||
'<div class="yaktube-modal-chip yaktube-recent-chip" data-query="' +
|
||||
safeTerm +
|
||||
'" aria-label="Son arama: ' +
|
||||
'" title="' +
|
||||
safeTerm +
|
||||
' için ara">' +
|
||||
'<span class="yaktube-recent-chip-text" data-query="' +
|
||||
safeTerm +
|
||||
'">🕒 ' +
|
||||
safeTerm +
|
||||
'</span>' +
|
||||
'<button type="button" class="yaktube-recent-chip-delete" data-delete-query="' +
|
||||
safeTerm +
|
||||
'" title="Bu aramayı geçmişten kaldır" aria-label="' +
|
||||
safeTerm +
|
||||
' aramasını geçmişten kaldır">✕</button>' +
|
||||
'</div>';
|
||||
});
|
||||
html += '</div>';
|
||||
} else if (filter.length > 0) {
|
||||
html +=
|
||||
'<div style="font-size: 12px; color: #94a3b8; margin-bottom: 14px; font-style: italic;">Geçmişte "' +
|
||||
filter.replace(/"/g, '"') +
|
||||
'" ile eşleşen kayıt bulunamadı.</div>';
|
||||
}
|
||||
|
||||
// 2. Popular & Trending searches section
|
||||
if (displayedPopular.length > 0) {
|
||||
html +=
|
||||
'<div class="yaktube-modal-section-title">🔥 ' +
|
||||
(filter.length > 0 ? 'Önerilen Aramalar' : 'Hızlı ve Popüler Aramalar') +
|
||||
'</div>' +
|
||||
'<div class="yaktube-modal-chips-grid">';
|
||||
|
||||
displayedPopular.forEach(function (item) {
|
||||
var safeQ = item.q.replace(/"/g, '"');
|
||||
html +=
|
||||
'<button class="yaktube-modal-chip" data-query="' +
|
||||
safeQ +
|
||||
'" aria-label="Popüler arama: ' +
|
||||
safeQ +
|
||||
'">' +
|
||||
item.title +
|
||||
'</button>';
|
||||
});
|
||||
html += '</div>';
|
||||
}
|
||||
|
||||
// 2. Popular & Trending searches section
|
||||
html +=
|
||||
'<div class="yaktube-modal-section-title">🔥 Hızlı ve Popüler Aramalar</div>' +
|
||||
'<div class="yaktube-modal-chips-grid">';
|
||||
|
||||
popularTrendingQueries.forEach(function (item) {
|
||||
var safeQ = item.q.replace(/"/g, '"');
|
||||
html +=
|
||||
'<button class="yaktube-modal-chip" data-query="' +
|
||||
safeQ +
|
||||
'" aria-label="Popüler arama: ' +
|
||||
safeQ +
|
||||
'">' +
|
||||
item.title +
|
||||
'</button>';
|
||||
});
|
||||
html += '</div>';
|
||||
|
||||
container.innerHTML = html;
|
||||
|
||||
// Attach click events
|
||||
container.querySelectorAll('.yaktube-recent-chip-delete').forEach(function (delBtn) {
|
||||
delBtn.addEventListener('click', function (e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
var delTerm = delBtn.getAttribute('data-delete-query');
|
||||
deleteRecentSearch(delTerm);
|
||||
});
|
||||
});
|
||||
|
||||
container.querySelectorAll('.yaktube-modal-chip').forEach(function (chip) {
|
||||
chip.addEventListener('click', function () {
|
||||
chip.addEventListener('click', function (e) {
|
||||
if (e.target && e.target.classList.contains('yaktube-recent-chip-delete')) {
|
||||
return;
|
||||
}
|
||||
var query = chip.getAttribute('data-query');
|
||||
var inp = modal.querySelector('#yaktube-modal-input');
|
||||
if (inp) inp.value = query;
|
||||
@@ -4576,19 +4656,22 @@ try {
|
||||
var voiceBtn = modal.querySelector('#yaktube-modal-voice-btn');
|
||||
var micPulseBtn = modal.querySelector('#yaktube-modal-mic-pulse');
|
||||
|
||||
// Input typing & clear
|
||||
// Input typing & live search history filtering
|
||||
inp.addEventListener('input', function () {
|
||||
if (inp.value && inp.value.trim().length > 0) {
|
||||
var val = (inp.value || '').trim();
|
||||
if (val.length > 0) {
|
||||
clearBtn.style.display = 'inline-flex';
|
||||
} else {
|
||||
clearBtn.style.display = 'none';
|
||||
}
|
||||
renderDynamicSearchChips(val);
|
||||
});
|
||||
|
||||
clearBtn.addEventListener('click', function () {
|
||||
inp.value = '';
|
||||
clearBtn.style.display = 'none';
|
||||
inp.focus();
|
||||
renderDynamicSearchChips('');
|
||||
announce('Arama metni temizlendi.');
|
||||
});
|
||||
|
||||
@@ -4632,14 +4715,6 @@ try {
|
||||
}
|
||||
});
|
||||
|
||||
// Chips click
|
||||
modal.querySelectorAll('.yaktube-modal-chip').forEach(function (chip) {
|
||||
chip.addEventListener('click', function () {
|
||||
var query = chip.getAttribute('data-query');
|
||||
executeSearch(query);
|
||||
});
|
||||
});
|
||||
|
||||
// Voice button click
|
||||
voiceBtn.addEventListener('click', function () {
|
||||
toggleVoiceInsideModal();
|
||||
@@ -5860,3 +5935,11 @@ try {
|
||||
} catch (err) {
|
||||
console.error('[YakTube] Safe catch error:', err);
|
||||
}
|
||||
|
||||
// PeerTube Plugin Client Hook Registration
|
||||
export async function register({ registerHook, peertubeHelpers } = {}) {
|
||||
return true;
|
||||
}
|
||||
|
||||
export { register as registerClient };
|
||||
export default register;
|
||||
@@ -607,6 +607,20 @@ async function register({ getRouter, registerSetting, settingsManager, peertubeH
|
||||
return false;
|
||||
}
|
||||
|
||||
function normalizeTitleForMatch(str) {
|
||||
if (!str) return '';
|
||||
return String(str)
|
||||
.replace(/&/g, '&')
|
||||
.replace(/'/g, "'")
|
||||
.replace(/"/g, '"')
|
||||
.replace(/[\u2010-\u2015]/g, '-')
|
||||
.replace(/\s*[\(\[](official|video|music|audio|clip|4k|hd|lyrics|sözleri|visualizer)[^\)\]]*[\)\]]/gi, '')
|
||||
.replace(/[^a-zA-Z0-9\u00C0-\u024F\u1E00-\u1EFF]/g, ' ')
|
||||
.replace(/\s+/g, ' ')
|
||||
.trim()
|
||||
.toLocaleLowerCase('tr');
|
||||
}
|
||||
|
||||
// Helper to enrich YouTube results with existing local PeerTube videos via DB
|
||||
async function enrichResultsWithLocalStatus(results) {
|
||||
try {
|
||||
@@ -643,10 +657,18 @@ async function register({ getRouter, registerSetting, settingsManager, peertubeH
|
||||
};
|
||||
}
|
||||
|
||||
const normalizedTitle = (item.title || '').toLowerCase().trim();
|
||||
const rawItemTitle = (item.title || '').toLowerCase().trim();
|
||||
const normItemTitle = normalizeTitleForMatch(item.title);
|
||||
|
||||
const matchedLocal = localVideos.find(lv => {
|
||||
const lvName = (lv.name || '').toLowerCase().trim();
|
||||
return lvName === normalizedTitle || (lvName.length > 5 && normalizedTitle.includes(lvName));
|
||||
const rawLv = (lv.name || '').toLowerCase().trim();
|
||||
if (rawLv === rawItemTitle) return true;
|
||||
const normLv = normalizeTitleForMatch(lv.name);
|
||||
return (
|
||||
normLv &&
|
||||
(normLv === normItemTitle ||
|
||||
(normLv.length > 5 && (normItemTitle.includes(normLv) || normLv.includes(normItemTitle))))
|
||||
);
|
||||
});
|
||||
|
||||
if (matchedLocal) {
|
||||
@@ -1318,13 +1340,20 @@ async function register({ getRouter, registerSetting, settingsManager, peertubeH
|
||||
if (q && q.length >= 2) {
|
||||
const filtered = currentList.filter(item => String(item).toLowerCase() !== q.toLowerCase());
|
||||
filtered.unshift(q);
|
||||
store[userKey] = filtered.slice(0, 12);
|
||||
store[userKey] = filtered.slice(0, 20);
|
||||
writeHistoryStore(store);
|
||||
}
|
||||
return res.json({ status: 'success', history: store[userKey] || currentList });
|
||||
}
|
||||
|
||||
if (req.method === 'DELETE') {
|
||||
const target = ((req.body && req.body.query) || (req.query && req.query.query) || '').trim();
|
||||
if (target) {
|
||||
const filtered = currentList.filter(item => String(item).toLowerCase() !== target.toLowerCase());
|
||||
store[userKey] = filtered;
|
||||
writeHistoryStore(store);
|
||||
return res.json({ status: 'success', history: filtered });
|
||||
}
|
||||
delete store[userKey];
|
||||
writeHistoryStore(store);
|
||||
return res.json({ status: 'success', history: [] });
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "peertube-plugin-yaktube-ondemand",
|
||||
"version": "1.6.6",
|
||||
"version": "1.7.0",
|
||||
"description": "Accessible On-Demand YouTube Import, Live Streams, Smart Recommendations, Sleep Timer, Touch Gestures, Voice Assistant & A11y Engine for PeerTube",
|
||||
"main": "main.js",
|
||||
"library": "./main.js",
|
||||
|
||||
@@ -810,6 +810,42 @@ my-search-typeahead,
|
||||
transform: translateY(-1px) !important;
|
||||
}
|
||||
|
||||
.yaktube-modal-chip.yaktube-recent-chip {
|
||||
padding: 6px 10px 6px 14px !important;
|
||||
gap: 8px !important;
|
||||
}
|
||||
|
||||
.yaktube-recent-chip-text {
|
||||
cursor: pointer !important;
|
||||
display: inline-flex !important;
|
||||
align-items: center !important;
|
||||
}
|
||||
|
||||
.yaktube-recent-chip-delete {
|
||||
background: rgba(255, 255, 255, 0.08) !important;
|
||||
border: none !important;
|
||||
color: #94a3b8 !important;
|
||||
font-size: 11px !important;
|
||||
font-weight: 700 !important;
|
||||
line-height: 1 !important;
|
||||
cursor: pointer !important;
|
||||
width: 18px !important;
|
||||
height: 18px !important;
|
||||
border-radius: 50% !important;
|
||||
display: inline-flex !important;
|
||||
align-items: center !important;
|
||||
justify-content: center !important;
|
||||
transition: all 0.2s ease !important;
|
||||
margin-left: 2px !important;
|
||||
padding: 0 !important;
|
||||
}
|
||||
|
||||
.yaktube-recent-chip-delete:hover {
|
||||
background: rgba(239, 68, 68, 0.35) !important;
|
||||
color: #ff6b6b !important;
|
||||
transform: scale(1.15) !important;
|
||||
}
|
||||
|
||||
.yaktube-modal-hint-footer {
|
||||
display: flex !important;
|
||||
justify-content: space-between !important;
|
||||
|
||||
Reference in New Issue
Block a user