Ajoute /cite, met à jour la CI et répare les liens de vidéo
Some checks failed
ci / deploy (push) Has been cancelled
ci-build / build (1.24) (push) Has been cancelled

This commit is contained in:
2026-04-16 14:31:07 +02:00
parent 92dade1312
commit bb3e174fb8
11 changed files with 875 additions and 522 deletions

View File

@@ -11,7 +11,7 @@ import (
type QuoteIndex struct {
index bleve.Index
Videos []Quote
videoByKey map[string]Quote //videoByKey[youtubeKey]
videoByPage map[string]Quote //videoByPage[youtubeKey]
}
// Search search quote in index
@@ -25,7 +25,7 @@ func (si *QuoteIndex) Search(str string) ([]Quote, error) {
return nil, fmt.Errorf("Request error %w", err)
}
for _, hit := range searchResults.Hits {
if sound, ok := si.videoByKey[hit.ID]; ok {
if sound, ok := si.videoByPage[hit.ID]; ok {
resp = append(resp, sound)
}
}
@@ -48,10 +48,10 @@ func indexQuotes(quotes []Quote) (*QuoteIndex, error) {
}
for _, quote := range quotes {
if index.Index(quote.YoutubeKey, quote.Quote) != nil {
if index.Index(quote.Page, quote.Quote) != nil {
log.Printf("Error indexing %v\n", quote.Quote)
}
quoteMap[quote.YoutubeKey] = quote
quoteMap[quote.Page] = quote
}
return &QuoteIndex{