embyhelper_test.go 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. package emby_helper
  2. import (
  3. "github.com/allanpk716/ChineseSubFinder/internal/pkg/config"
  4. "testing"
  5. )
  6. func TestEmbyHelper_GetRecentlyAddVideoList(t *testing.T) {
  7. config := config.GetConfig()
  8. em := NewEmbyHelper(config.EmbyConfig)
  9. movieList, seriesList, err := em.GetRecentlyAddVideoList(config.MovieFolder, config.SeriesFolder)
  10. if err != nil {
  11. t.Fatal(err)
  12. }
  13. println(len(movieList), len(seriesList))
  14. }
  15. func TestEmbyHelper_RefreshEmbySubList(t *testing.T) {
  16. config := config.GetConfig()
  17. em := NewEmbyHelper(config.EmbyConfig)
  18. bok, err := em.RefreshEmbySubList()
  19. if err != nil {
  20. t.Fatal(err)
  21. }
  22. println(bok)
  23. }
  24. func TestEmbyHelper_GetInternalEngSubAndExSub(t *testing.T) {
  25. config := config.GetConfig()
  26. em := NewEmbyHelper(config.EmbyConfig)
  27. // 81873 -- R&M - S05E01
  28. // R&M S05E10 2 org english, 5 简英 145499
  29. // 基地 S01E03 166840
  30. found, internalEngSub, exCh_EngSub, err := em.GetInternalEngSubAndExChineseEnglishSub("166840")
  31. if err != nil {
  32. t.Fatal(err)
  33. }
  34. if found == false {
  35. t.Fatal("need found sub")
  36. }
  37. println(internalEngSub[0].FileName, exCh_EngSub[0].FileName)
  38. }