Добавил обновление библиотеки jellyfin после добавления медиа
This commit is contained in:
@@ -73,6 +73,30 @@ func TestNotifier_FiresOnDone(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
// recordingScanner ловит вызовы пересканирования Jellyfin (RefreshLibraries
|
||||
// асинхронен — через канал).
|
||||
type recordingScanner struct{ ch chan struct{} }
|
||||
|
||||
func (s *recordingScanner) RefreshLibraries(_ context.Context) error {
|
||||
s.ch <- struct{}{}
|
||||
return nil
|
||||
}
|
||||
|
||||
func TestScanner_FiresOnDone(t *testing.T) {
|
||||
f := newApplyFixture(t, seriesResult().Plan)
|
||||
s := &recordingScanner{ch: make(chan struct{}, 4)}
|
||||
f.w.SetScanner(s)
|
||||
|
||||
if err := f.w.Apply(context.Background(), 1); err != nil {
|
||||
t.Fatalf("Apply: %v", err)
|
||||
}
|
||||
select {
|
||||
case <-s.ch:
|
||||
case <-time.After(2 * time.Second):
|
||||
t.Fatal("пересканирование Jellyfin не запустилось")
|
||||
}
|
||||
}
|
||||
|
||||
// memStore — полноценный in-memory store для тестов Ф3.
|
||||
type memStore struct {
|
||||
downloads map[int64]*store.Download
|
||||
|
||||
Reference in New Issue
Block a user