Преглед на файлове

feat:删除音乐模块

kailen преди 6 дни
родител
ревизия
fc2221668b
променени са 100 файла, в които са добавени 83 реда и са изтрити 10788 реда
  1. 1 1
      Bridging-Header.h
  2. 0 5
      Podfile
  3. 2 123
      Podfile.lock
  4. 30 654
      TSLiveWallpaper.xcodeproj/project.pbxproj
  5. BIN
      TSLiveWallpaper/.DS_Store
  6. 0 51
      TSLiveWallpaper/AppDelegate.swift
  7. 23 0
      TSLiveWallpaper/Assets.xcassets/Vip/Old-Tim.imageset/Contents.json
  8. BIN
      TSLiveWallpaper/Assets.xcassets/Vip/Old-Tim.imageset/Old-Tim@1x.png
  9. BIN
      TSLiveWallpaper/Assets.xcassets/Vip/Old-Tim.imageset/Old-Tim@2x.png
  10. BIN
      TSLiveWallpaper/Assets.xcassets/Vip/Old-Tim.imageset/Old-Tim@3x.png
  11. 23 0
      TSLiveWallpaper/Assets.xcassets/Vip/Old-Tim_pro.imageset/Contents.json
  12. BIN
      TSLiveWallpaper/Assets.xcassets/Vip/Old-Tim_pro.imageset/Old-Tim_pro@1x.png
  13. BIN
      TSLiveWallpaper/Assets.xcassets/Vip/Old-Tim_pro.imageset/Old-Tim_pro@2x.png
  14. BIN
      TSLiveWallpaper/Assets.xcassets/Vip/Old-Tim_pro.imageset/Old-Tim_pro@3x.png
  15. 3 3
      TSLiveWallpaper/Base.lproj/LaunchScreen.storyboard
  16. 0 138
      TSLiveWallpaper/Business/AdMob/ADLoadingViewController.swift
  17. 0 88
      TSLiveWallpaper/Business/AdMob/ADScene.swift
  18. 0 50
      TSLiveWallpaper/Business/AdMob/AppConfig.swift
  19. 0 62
      TSLiveWallpaper/Business/AdMob/GoogleMobileAdsConsentManager.swift
  20. 1 1
      TSLiveWallpaper/Business/TSMineVC/TSMineVC.swift
  21. 0 14
      TSLiveWallpaper/Business/TSMusic/Consts/Consts.swift
  22. 0 64
      TSLiveWallpaper/Business/TSMusic/Custom/BasePresentViewController.swift
  23. 0 135
      TSLiveWallpaper/Business/TSMusic/Custom/BubbleMenuView.swift
  24. 0 25
      TSLiveWallpaper/Business/TSMusic/Custom/FitManager.swift
  25. 0 70
      TSLiveWallpaper/Business/TSMusic/Custom/ImageTextControl.swift
  26. 0 75
      TSLiveWallpaper/Business/TSMusic/Custom/ManageMenuAlertView.swift
  27. 0 102
      TSLiveWallpaper/Business/TSMusic/Custom/MusicEmptyView.swift
  28. 0 59
      TSLiveWallpaper/Business/TSMusic/Custom/MusicSearchBar.swift
  29. 0 21
      TSLiveWallpaper/Business/TSMusic/Custom/NotifactionKey.swift
  30. 0 149
      TSLiveWallpaper/Business/TSMusic/Custom/PlayMiniBar.swift
  31. 0 92
      TSLiveWallpaper/Business/TSMusic/Custom/THUD+CW.swift
  32. 0 100
      TSLiveWallpaper/Business/TSMusic/Custom/THUD.swift
  33. 0 20
      TSLiveWallpaper/Business/TSMusic/Custom/THUDProtocol.swift
  34. 0 125
      TSLiveWallpaper/Business/TSMusic/Custom/TipsView.swift
  35. 0 206
      TSLiveWallpaper/Business/TSMusic/Custom/ToastView.swift
  36. 0 29
      TSLiveWallpaper/Business/TSMusic/Detail/Controller/PlayDetailViewController+Ext.swift
  37. 0 553
      TSLiveWallpaper/Business/TSMusic/Detail/Controller/PlayDetailViewController.swift
  38. 0 206
      TSLiveWallpaper/Business/TSMusic/Detail/Controller/SleepTimeViewController.swift
  39. 0 230
      TSLiveWallpaper/Business/TSMusic/Detail/PlayerManager.swift
  40. 0 301
      TSLiveWallpaper/Business/TSMusic/Detail/View/PlayDetailControlView.swift
  41. 0 38
      TSLiveWallpaper/Business/TSMusic/Detail/View/PlayDetailPlaceHolderView.swift
  42. 0 91
      TSLiveWallpaper/Business/TSMusic/Detail/View/PlayDetailTopView.swift
  43. 0 62
      TSLiveWallpaper/Business/TSMusic/Helper/CWCustomProgressView.swift
  44. 0 53
      TSLiveWallpaper/Business/TSMusic/Helper/CWLoadingView.swift
  45. 0 44
      TSLiveWallpaper/Business/TSMusic/Helper/CWMutiSelectOpeateView.swift
  46. 0 50
      TSLiveWallpaper/Business/TSMusic/Helper/CWOperateItemView.swift
  47. 0 152
      TSLiveWallpaper/Business/TSMusic/Helper/CWOperateViewController+Ext.swift
  48. 0 123
      TSLiveWallpaper/Business/TSMusic/Helper/CWOperateViewController.swift
  49. 0 550
      TSLiveWallpaper/Business/TSMusic/Helper/CWProgressView.swift
  50. 0 174
      TSLiveWallpaper/Business/TSMusic/Helper/FilterBarView.swift
  51. 0 147
      TSLiveWallpaper/Business/TSMusic/Helper/FilterBarViewController.swift
  52. 0 82
      TSLiveWallpaper/Business/TSMusic/Helper/FilterBarViewModel.swift
  53. 0 57
      TSLiveWallpaper/Business/TSMusic/Helper/GuideBubbleView.swift
  54. 0 135
      TSLiveWallpaper/Business/TSMusic/Helper/OperateTopView.swift
  55. 0 185
      TSLiveWallpaper/Business/TSMusic/Helper/SortMenuViewController.swift
  56. 0 40
      TSLiveWallpaper/Business/TSMusic/Helper/VipTagView.swift
  57. 0 128
      TSLiveWallpaper/Business/TSMusic/Import/ImportFilesManager.swift
  58. 0 103
      TSLiveWallpaper/Business/TSMusic/List/Controller/CustomSegementItem.swift
  59. 0 157
      TSLiveWallpaper/Business/TSMusic/List/Controller/MusicHomeContainerViewController.swift
  60. 0 162
      TSLiveWallpaper/Business/TSMusic/List/Controller/MusicPlaylistContainerViewController.swift
  61. 0 91
      TSLiveWallpaper/Business/TSMusic/List/Controller/SongListViewController+Target.swift
  62. 0 271
      TSLiveWallpaper/Business/TSMusic/List/Controller/SongListViewController.swift
  63. 0 42
      TSLiveWallpaper/Business/TSMusic/List/View/CDView.swift
  64. 0 95
      TSLiveWallpaper/Business/TSMusic/List/View/PlaylistTopView.swift
  65. 0 243
      TSLiveWallpaper/Business/TSMusic/List/View/SongDownloadCell.swift
  66. 0 189
      TSLiveWallpaper/Business/TSMusic/List/View/SongListCell.swift
  67. 0 75
      TSLiveWallpaper/Business/TSMusic/List/View/SongListTopView.swift
  68. 0 12
      TSLiveWallpaper/Business/TSMusic/List/ViewModel/MusicContainerViewModel.swift
  69. 0 60
      TSLiveWallpaper/Business/TSMusic/List/ViewModel/SongDownloadCellViewModel.swift
  70. 0 162
      TSLiveWallpaper/Business/TSMusic/List/ViewModel/SongListViewModel.swift
  71. 0 26
      TSLiveWallpaper/Business/TSMusic/MusicBase/GradientBackgroundModifier.swift
  72. 0 44
      TSLiveWallpaper/Business/TSMusic/MusicBase/GradientText.swift
  73. 0 116
      TSLiveWallpaper/Business/TSMusic/MusicBase/SaveSuccessTipsView.swift
  74. 0 29
      TSLiveWallpaper/Business/TSMusic/OC/IJKPlayer/Core/SJIJKMediaPlayer.h
  75. 0 616
      TSLiveWallpaper/Business/TSMusic/OC/IJKPlayer/Core/SJIJKMediaPlayer.m
  76. 0 24
      TSLiveWallpaper/Business/TSMusic/OC/IJKPlayer/Core/SJIJKMediaPlayerLayerView.h
  77. 0 46
      TSLiveWallpaper/Business/TSMusic/OC/IJKPlayer/Core/SJIJKMediaPlayerLayerView.m
  78. 0 0
      TSLiveWallpaper/Business/TSMusic/OC/IJKPlayer/IJKPlayer.md
  79. 0 22
      TSLiveWallpaper/Business/TSMusic/OC/IJKPlayer/SJIJKMediaPlaybackController.h
  80. 0 95
      TSLiveWallpaper/Business/TSMusic/OC/IJKPlayer/SJIJKMediaPlaybackController.m
  81. 0 8
      TSLiveWallpaper/Business/TSMusic/OC/IJKPlayer/TSAvatar-Header.h
  82. 0 208
      TSLiveWallpaper/Business/TSMusic/PlayList/Controller/AddPlayListViewController.swift
  83. 0 122
      TSLiveWallpaper/Business/TSMusic/PlayList/Controller/PlayDetailListViewContoller.swift
  84. 0 356
      TSLiveWallpaper/Business/TSMusic/PlayList/Controller/PlaylistDetailViewController.swift
  85. 0 32
      TSLiveWallpaper/Business/TSMusic/PlayList/Controller/PlaylistViewController+Ext.swift
  86. 0 133
      TSLiveWallpaper/Business/TSMusic/PlayList/Controller/PlaylistViewController.swift
  87. 0 72
      TSLiveWallpaper/Business/TSMusic/PlayList/ViewModel/AddPlayListViewModel.swift
  88. 0 77
      TSLiveWallpaper/Business/TSMusic/PlayList/ViewModel/PlayDetailListViewModel.swift
  89. 0 88
      TSLiveWallpaper/Business/TSMusic/PlayList/ViewModel/PlayListDetaiViewModel.swift
  90. 0 84
      TSLiveWallpaper/Business/TSMusic/PlayList/ViewModel/PlayListViewModel.swift
  91. 0 145
      TSLiveWallpaper/Business/TSMusic/PlayList/ViewModel/SongListManageViewModel.swift
  92. 0 131
      TSLiveWallpaper/Business/TSMusic/PlayList/Views/PlayDetailListViewCell.swift
  93. 0 57
      TSLiveWallpaper/Business/TSMusic/PlayList/Views/PlayListAddCell.swift
  94. 0 134
      TSLiveWallpaper/Business/TSMusic/PlayList/Views/PlayListCell.swift
  95. 0 74
      TSLiveWallpaper/Business/TSMusic/PlayList/Views/PlayListManageView.swift
  96. 0 43
      TSLiveWallpaper/Business/TSMusic/PlayList/Views/PlayListTopItemView.swift
  97. 0 71
      TSLiveWallpaper/Business/TSMusic/PlayList/Views/SongListBottomView.swift
  98. 0 140
      TSLiveWallpaper/Business/TSMusic/Search/Controller/LocalSearchViewController.swift
  99. 0 217
      TSLiveWallpaper/Business/TSMusic/Search/Controller/SearchOnlineViewController.swift
  100. 0 53
      TSLiveWallpaper/Business/TSMusic/Search/ViewModel/LocalSearchViewModel.swift

+ 1 - 1
Bridging-Header.h

@@ -3,4 +3,4 @@
 //
 //
 
 
 #import "LivePhotoUtil.h"
 #import "LivePhotoUtil.h"
-#import "SJIJKMediaPlaybackController.h"
+

+ 0 - 5
Podfile

@@ -14,20 +14,15 @@ target 'TSLiveWallpaper' do
   pod 'SVProgressHUD'
   pod 'SVProgressHUD'
   pod 'Kingfisher', '7.10.0'
   pod 'Kingfisher', '7.10.0'
   pod 'TYCyclePagerView'
   pod 'TYCyclePagerView'
-  pod 'Google-Mobile-Ads-SDK'
   pod 'Alamofire'
   pod 'Alamofire'
   
   
   pod 'TZImagePickerController'
   pod 'TZImagePickerController'
   pod 'MarqueeLabel'
   pod 'MarqueeLabel'
   pod 'MJRefresh'
   pod 'MJRefresh'
-  pod 'TSVideoKit', :git => 'https://gitee.com/WanlanNeel/tsvideo-kit.git', :branch => 'feature/mini'
-  pod "IJKMediaPlayerKit", :podspec => 'https://github.com/debugly/ijkplayer/releases/download/k0.11.8/IJKMediaPlayerKit.spec.json'
   pod 'KLExtension',:git=>"https://gitee.com/WanlanNeel/klextension.git"
   pod 'KLExtension',:git=>"https://gitee.com/WanlanNeel/klextension.git"
   pod 'KLTips',:git=>"https://gitee.com/WanlanNeel/kltips.git"
   pod 'KLTips',:git=>"https://gitee.com/WanlanNeel/kltips.git"
   pod 'Localize-Swift', '~> 3.2'
   pod 'Localize-Swift', '~> 3.2'
   pod 'BetterSegmentedControl', '~> 2.0'
   pod 'BetterSegmentedControl', '~> 2.0'
-  pod 'Google-Mobile-Ads-SDK'
-  pod 'ADManager', :path => '../TSCoacopods/ADManager'
   
   
 end
 end
 
 

+ 2 - 123
Podfile.lock

@@ -1,27 +1,6 @@
 PODS:
 PODS:
-  - ADManager (1.0):
-    - Google-Mobile-Ads-SDK
-  - AFNetworking (4.0.1):
-    - AFNetworking/NSURLSession (= 4.0.1)
-    - AFNetworking/Reachability (= 4.0.1)
-    - AFNetworking/Security (= 4.0.1)
-    - AFNetworking/Serialization (= 4.0.1)
-    - AFNetworking/UIKit (= 4.0.1)
-  - AFNetworking/NSURLSession (4.0.1):
-    - AFNetworking/Reachability
-    - AFNetworking/Security
-    - AFNetworking/Serialization
-  - AFNetworking/Reachability (4.0.1)
-  - AFNetworking/Security (4.0.1)
-  - AFNetworking/Serialization (4.0.1)
-  - AFNetworking/UIKit (4.0.1):
-    - AFNetworking/NSURLSession
   - Alamofire (5.10.2)
   - Alamofire (5.10.2)
   - BetterSegmentedControl (2.0.1)
   - BetterSegmentedControl (2.0.1)
-  - Google-Mobile-Ads-SDK (11.12.0):
-    - GoogleUserMessagingPlatform (>= 1.1)
-  - GoogleUserMessagingPlatform (2.7.0)
-  - IJKMediaPlayerKit (0.11.8)
   - Kingfisher (7.10.0)
   - Kingfisher (7.10.0)
   - KLExtension (0.1.0)
   - KLExtension (0.1.0)
   - KLTips (0.1.0)
   - KLTips (0.1.0)
@@ -32,92 +11,22 @@ PODS:
   - Localize-Swift/UIKit (3.2.0):
   - Localize-Swift/UIKit (3.2.0):
     - Localize-Swift/LocalizeSwiftCore
     - Localize-Swift/LocalizeSwiftCore
   - MarqueeLabel (4.5.0)
   - MarqueeLabel (4.5.0)
-  - Masonry (1.1.0)
   - MJRefresh (3.7.5)
   - MJRefresh (3.7.5)
   - ObjectMapper (4.2.0)
   - ObjectMapper (4.2.0)
-  - SJBaseVideoPlayer (3.7.7.1):
-    - Masonry
-    - SJBaseVideoPlayer/AVPlayer (= 3.7.7.1)
-    - SJBaseVideoPlayer/Common (= 3.7.7.1)
-    - SJUIKit/AttributesFactory (>= 0.0.0.38)
-    - SJUIKit/ObserverHelper
-    - SJUIKit/Queues
-    - SJUIKit/SQLite3
-  - SJBaseVideoPlayer/AVPlayer (3.7.7.1):
-    - Masonry
-    - SJBaseVideoPlayer/Common
-    - SJUIKit/AttributesFactory (>= 0.0.0.38)
-    - SJUIKit/ObserverHelper
-    - SJUIKit/Queues
-    - SJUIKit/SQLite3
-  - SJBaseVideoPlayer/Common (3.7.7.1):
-    - Masonry
-    - SJBaseVideoPlayer/ResourceLoader
-    - SJUIKit/AttributesFactory (>= 0.0.0.38)
-    - SJUIKit/ObserverHelper
-    - SJUIKit/Queues
-    - SJUIKit/SQLite3
-  - SJBaseVideoPlayer/ResourceLoader (3.7.7.1):
-    - Masonry
-    - SJUIKit/AttributesFactory (>= 0.0.0.38)
-    - SJUIKit/ObserverHelper
-    - SJUIKit/Queues
-    - SJUIKit/SQLite3
-  - SJUIKit/AttributesFactory (0.0.0.59):
-    - SJUIKit/AttributesFactory/Deprecated (= 0.0.0.59)
-    - SJUIKit/AttributesFactory/UIKitText (= 0.0.0.59)
-  - SJUIKit/AttributesFactory/Deprecated (0.0.0.59)
-  - SJUIKit/AttributesFactory/UIKitText (0.0.0.59)
-  - SJUIKit/ObserverHelper (0.0.0.59)
-  - SJUIKit/Queues (0.0.0.59)
-  - SJUIKit/SQLite3 (0.0.0.59):
-    - SJUIKit/SQLite3/Core (= 0.0.0.59)
-    - SJUIKit/SQLite3/Protocol (= 0.0.0.59)
-    - YYModel
-  - SJUIKit/SQLite3/Core (0.0.0.59):
-    - SJUIKit/SQLite3/Protocol
-    - YYModel
-  - SJUIKit/SQLite3/Protocol (0.0.0.59):
-    - YYModel
-  - SJVideoPlayer (3.4.3):
-    - SJBaseVideoPlayer (>= 3.7.5)
-    - SJVideoPlayer/Common (= 3.4.3)
-    - SJVideoPlayer/ControlLayers (= 3.4.3)
-    - SJVideoPlayer/ResourceLoader (= 3.4.3)
-  - SJVideoPlayer/Common (3.4.3):
-    - Masonry
-    - SJBaseVideoPlayer (>= 3.7.5)
-    - SJUIKit/AttributesFactory
-    - SJVideoPlayer/ResourceLoader
-  - SJVideoPlayer/ControlLayers (3.4.3):
-    - SJBaseVideoPlayer (>= 3.7.5)
-    - SJVideoPlayer/Common
-  - SJVideoPlayer/ResourceLoader (3.4.3):
-    - SJBaseVideoPlayer (>= 3.7.5)
   - SnapKit (5.7.1)
   - SnapKit (5.7.1)
   - SVProgressHUD (2.3.1):
   - SVProgressHUD (2.3.1):
     - SVProgressHUD/Core (= 2.3.1)
     - SVProgressHUD/Core (= 2.3.1)
   - SVProgressHUD/Core (2.3.1)
   - SVProgressHUD/Core (2.3.1)
-  - TSVideoKit (0.1.0):
-    - AFNetworking
-    - Alamofire
-    - Kingfisher
-    - SJVideoPlayer
-    - SnapKit
   - TYCyclePagerView (1.2.0)
   - TYCyclePagerView (1.2.0)
   - TZImagePickerController (3.8.8):
   - TZImagePickerController (3.8.8):
     - TZImagePickerController/Basic (= 3.8.8)
     - TZImagePickerController/Basic (= 3.8.8)
     - TZImagePickerController/Location (= 3.8.8)
     - TZImagePickerController/Location (= 3.8.8)
   - TZImagePickerController/Basic (3.8.8)
   - TZImagePickerController/Basic (3.8.8)
   - TZImagePickerController/Location (3.8.8)
   - TZImagePickerController/Location (3.8.8)
-  - YYModel (1.0.4)
 
 
 DEPENDENCIES:
 DEPENDENCIES:
-  - ADManager (from `../TSCoacopods/ADManager`)
   - Alamofire
   - Alamofire
   - BetterSegmentedControl (~> 2.0)
   - BetterSegmentedControl (~> 2.0)
-  - Google-Mobile-Ads-SDK
-  - IJKMediaPlayerKit (from `https://github.com/debugly/ijkplayer/releases/download/k0.11.8/IJKMediaPlayerKit.spec.json`)
   - Kingfisher (= 7.10.0)
   - Kingfisher (= 7.10.0)
   - KLExtension (from `https://gitee.com/WanlanNeel/klextension.git`)
   - KLExtension (from `https://gitee.com/WanlanNeel/klextension.git`)
   - KLTips (from `https://gitee.com/WanlanNeel/kltips.git`)
   - KLTips (from `https://gitee.com/WanlanNeel/kltips.git`)
@@ -127,44 +36,28 @@ DEPENDENCIES:
   - ObjectMapper (= 4.2)
   - ObjectMapper (= 4.2)
   - SnapKit
   - SnapKit
   - SVProgressHUD
   - SVProgressHUD
-  - TSVideoKit (from `https://gitee.com/WanlanNeel/tsvideo-kit.git`, branch `feature/mini`)
   - TYCyclePagerView
   - TYCyclePagerView
   - TZImagePickerController
   - TZImagePickerController
 
 
 SPEC REPOS:
 SPEC REPOS:
   trunk:
   trunk:
-    - AFNetworking
     - Alamofire
     - Alamofire
     - BetterSegmentedControl
     - BetterSegmentedControl
-    - Google-Mobile-Ads-SDK
-    - GoogleUserMessagingPlatform
     - Kingfisher
     - Kingfisher
     - Localize-Swift
     - Localize-Swift
     - MarqueeLabel
     - MarqueeLabel
-    - Masonry
     - MJRefresh
     - MJRefresh
     - ObjectMapper
     - ObjectMapper
-    - SJBaseVideoPlayer
-    - SJUIKit
-    - SJVideoPlayer
     - SnapKit
     - SnapKit
     - SVProgressHUD
     - SVProgressHUD
     - TYCyclePagerView
     - TYCyclePagerView
     - TZImagePickerController
     - TZImagePickerController
-    - YYModel
 
 
 EXTERNAL SOURCES:
 EXTERNAL SOURCES:
-  ADManager:
-    :path: "../TSCoacopods/ADManager"
-  IJKMediaPlayerKit:
-    :podspec: https://github.com/debugly/ijkplayer/releases/download/k0.11.8/IJKMediaPlayerKit.spec.json
   KLExtension:
   KLExtension:
     :git: https://gitee.com/WanlanNeel/klextension.git
     :git: https://gitee.com/WanlanNeel/klextension.git
   KLTips:
   KLTips:
     :git: https://gitee.com/WanlanNeel/kltips.git
     :git: https://gitee.com/WanlanNeel/kltips.git
-  TSVideoKit:
-    :branch: feature/mini
-    :git: https://gitee.com/WanlanNeel/tsvideo-kit.git
 
 
 CHECKOUT OPTIONS:
 CHECKOUT OPTIONS:
   KLExtension:
   KLExtension:
@@ -173,36 +66,22 @@ CHECKOUT OPTIONS:
   KLTips:
   KLTips:
     :commit: dc38e277b3d62f753ce6c73ec62c0f8ae29c1b36
     :commit: dc38e277b3d62f753ce6c73ec62c0f8ae29c1b36
     :git: https://gitee.com/WanlanNeel/kltips.git
     :git: https://gitee.com/WanlanNeel/kltips.git
-  TSVideoKit:
-    :commit: c67bc820c784aa480f7de9b7ae302f5834b67ce7
-    :git: https://gitee.com/WanlanNeel/tsvideo-kit.git
 
 
 SPEC CHECKSUMS:
 SPEC CHECKSUMS:
-  ADManager: 69cd1b8805b2e64a72315ed2abfa1f1c02f8f879
-  AFNetworking: 3bd23d814e976cd148d7d44c3ab78017b744cd58
   Alamofire: 7193b3b92c74a07f85569e1a6c4f4237291e7496
   Alamofire: 7193b3b92c74a07f85569e1a6c4f4237291e7496
   BetterSegmentedControl: 09607b27861d49cbce48b7673b74f9150a3d371a
   BetterSegmentedControl: 09607b27861d49cbce48b7673b74f9150a3d371a
-  Google-Mobile-Ads-SDK: 3a76704456669fbed2057efc8bdb99050ad0e3fb
-  GoogleUserMessagingPlatform: a8b56893477f67212fbc8411c139e61d463349f5
-  IJKMediaPlayerKit: 3444702ec61bc649e7e81a9c0e19fda661bef1ce
   Kingfisher: a18f05d3b6d37d8650ee4a3e61d57a28fc6207f6
   Kingfisher: a18f05d3b6d37d8650ee4a3e61d57a28fc6207f6
   KLExtension: f8b2a92125ad4bbfc8920ed5e7269aefcdcaa0b3
   KLExtension: f8b2a92125ad4bbfc8920ed5e7269aefcdcaa0b3
   KLTips: 5cf05efac78b9c813887460bebbf436582b20536
   KLTips: 5cf05efac78b9c813887460bebbf436582b20536
   Localize-Swift: 6f4475136bdb0d7b2882ea3d4ea919d70142b232
   Localize-Swift: 6f4475136bdb0d7b2882ea3d4ea919d70142b232
   MarqueeLabel: 4b46d196abd253448e830cbd976f9eacc3af0849
   MarqueeLabel: 4b46d196abd253448e830cbd976f9eacc3af0849
-  Masonry: 678fab65091a9290e40e2832a55e7ab731aad201
   MJRefresh: fdf5e979eb406a0341468932d1dfc8b7f9fce961
   MJRefresh: fdf5e979eb406a0341468932d1dfc8b7f9fce961
   ObjectMapper: 1eb41f610210777375fa806bf161dc39fb832b81
   ObjectMapper: 1eb41f610210777375fa806bf161dc39fb832b81
-  SJBaseVideoPlayer: b3122de12225b27b71bd9a8a1f08f4dcf2f4e5ec
-  SJUIKit: a40111941e408cc17d4c1c23495aa92999e814b0
-  SJVideoPlayer: 4f09814f58522e0975cb2dccfda925f6c8643467
   SnapKit: d612e99e678a2d3b95bf60b0705ed0a35c03484a
   SnapKit: d612e99e678a2d3b95bf60b0705ed0a35c03484a
   SVProgressHUD: 4837c74bdfe2e51e8821c397825996a8d7de6e22
   SVProgressHUD: 4837c74bdfe2e51e8821c397825996a8d7de6e22
-  TSVideoKit: 16761d4bf8bb9e8af192459ae9eb01a213fc1531
   TYCyclePagerView: 2b051dade0615c70784aa34f40c646feeddb7344
   TYCyclePagerView: 2b051dade0615c70784aa34f40c646feeddb7344
   TZImagePickerController: d084a7b97c82d387e7669dd86dc9a9057500aacf
   TZImagePickerController: d084a7b97c82d387e7669dd86dc9a9057500aacf
-  YYModel: 2a7fdd96aaa4b86a824e26d0c517de8928c04b30
 
 
-PODFILE CHECKSUM: 436b32429cb708cca90f47b70a0a376c1a6e0417
+PODFILE CHECKSUM: c5b3dcc264f3a6ac46864c82a0bcb924969afc2a
 
 
-COCOAPODS: 1.15.2
+COCOAPODS: 1.16.2

+ 30 - 654
TSLiveWallpaper.xcodeproj/project.pbxproj

@@ -8,110 +8,15 @@
 
 
 /* Begin PBXBuildFile section */
 /* Begin PBXBuildFile section */
 		059E844A164B0E39971303B9 /* Pods_TSLiveWallpaper.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E33A770AEFA5810AED7219D3 /* Pods_TSLiveWallpaper.framework */; };
 		059E844A164B0E39971303B9 /* Pods_TSLiveWallpaper.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E33A770AEFA5810AED7219D3 /* Pods_TSLiveWallpaper.framework */; };
-		60553F722D3B528A00BAAD7F /* PlayDetailListViewContoller.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60553F242D3B528A00BAAD7F /* PlayDetailListViewContoller.swift */; };
-		60553F732D3B528A00BAAD7F /* SearchResultViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60553F0F2D3B528A00BAAD7F /* SearchResultViewModel.swift */; };
-		60553F742D3B528A00BAAD7F /* Consts.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60553F282D3B528A00BAAD7F /* Consts.swift */; };
-		60553F752D3B528A00BAAD7F /* MusicEmptyView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60553F6E2D3B528A00BAAD7F /* MusicEmptyView.swift */; };
-		60553F762D3B528A00BAAD7F /* CWMutiSelectOpeateView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60553F392D3B528A00BAAD7F /* CWMutiSelectOpeateView.swift */; };
-		60553F772D3B528A00BAAD7F /* DownloadButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60553F302D3B528A00BAAD7F /* DownloadButton.swift */; };
-		60553F782D3B528A00BAAD7F /* ManageMenuAlertView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60553F632D3B528A00BAAD7F /* ManageMenuAlertView.swift */; };
-		60553F792D3B528A00BAAD7F /* SongListBottomView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60553F162D3B528A00BAAD7F /* SongListBottomView.swift */; };
-		60553F7A2D3B528A00BAAD7F /* PlaylistViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60553F202D3B528A00BAAD7F /* PlaylistViewController.swift */; };
-		60553F7B2D3B528A00BAAD7F /* PlaylistTopView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60553F582D3B528A00BAAD7F /* PlaylistTopView.swift */; };
-		60553F7C2D3B528A00BAAD7F /* AddPlayListViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60553F232D3B528A00BAAD7F /* AddPlayListViewController.swift */; };
-		60553F7D2D3B528A00BAAD7F /* PlayDetailTopView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60553F4A2D3B528A00BAAD7F /* PlayDetailTopView.swift */; };
-		60553F7E2D3B528A00BAAD7F /* CWOperateViewController+Ext.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60553F362D3B528A00BAAD7F /* CWOperateViewController+Ext.swift */; };
-		60553F7F2D3B528A00BAAD7F /* OperateTopView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60553F3A2D3B528A00BAAD7F /* OperateTopView.swift */; };
-		60553F802D3B528A00BAAD7F /* PlayDetailViewController+Ext.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60553F502D3B528A00BAAD7F /* PlayDetailViewController+Ext.swift */; };
-		60553F812D3B528A00BAAD7F /* SJIJKMediaPlayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 60553F042D3B528A00BAAD7F /* SJIJKMediaPlayer.m */; };
-		60553F822D3B528A00BAAD7F /* SearchResultViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60553F0E2D3B528A00BAAD7F /* SearchResultViewController.swift */; };
-		60553F832D3B528A00BAAD7F /* THUD+CW.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60553F6A2D3B528A00BAAD7F /* THUD+CW.swift */; };
-		60553F842D3B528A00BAAD7F /* SongListManageViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60553F1D2D3B528A00BAAD7F /* SongListManageViewModel.swift */; };
-		60553F852D3B528A00BAAD7F /* SongDownloadCellViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60553F5B2D3B528A00BAAD7F /* SongDownloadCellViewModel.swift */; };
-		60553F862D3B528A00BAAD7F /* PlayDetailControlView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60553F4B2D3B528A00BAAD7F /* PlayDetailControlView.swift */; };
-		60553F872D3B528A00BAAD7F /* PlayDetailListViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60553F1E2D3B528A00BAAD7F /* PlayDetailListViewModel.swift */; };
-		60553F882D3B528A00BAAD7F /* SearchViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60553F3C2D3B528A00BAAD7F /* SearchViewModel.swift */; };
-		60553F892D3B528A00BAAD7F /* CWOperateViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60553F352D3B528A00BAAD7F /* CWOperateViewController.swift */; };
-		60553F8A2D3B528A00BAAD7F /* THUDProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60553F692D3B528A00BAAD7F /* THUDProtocol.swift */; };
-		60553F8B2D3B528A00BAAD7F /* THUD.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60553F682D3B528A00BAAD7F /* THUD.swift */; };
-		60553F8C2D3B528A00BAAD7F /* PlayDetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60553F4F2D3B528A00BAAD7F /* PlayDetailViewController.swift */; };
-		60553F8D2D3B528A00BAAD7F /* CWCustomProgressView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60553F312D3B528A00BAAD7F /* CWCustomProgressView.swift */; };
-		60553F8E2D3B528A00BAAD7F /* PlaylistDetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60553F222D3B528A00BAAD7F /* PlaylistDetailViewController.swift */; };
-		60553F8F2D3B528A00BAAD7F /* SleepTimeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60553F4E2D3B528A00BAAD7F /* SleepTimeViewController.swift */; };
-		60553F902D3B528A00BAAD7F /* CWLoadingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60553F342D3B528A00BAAD7F /* CWLoadingView.swift */; };
-		60553F912D3B528A00BAAD7F /* PlayListDetaiViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60553F1B2D3B528A00BAAD7F /* PlayListDetaiViewModel.swift */; };
-		60553F922D3B528A00BAAD7F /* SJIJKMediaPlayerLayerView.m in Sources */ = {isa = PBXBuildFile; fileRef = 60553F062D3B528A00BAAD7F /* SJIJKMediaPlayerLayerView.m */; };
-		60553F932D3B528A00BAAD7F /* CWSearchTextBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60553F402D3B528A00BAAD7F /* CWSearchTextBar.swift */; };
-		60553F942D3B528A00BAAD7F /* SongListCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60553F542D3B528A00BAAD7F /* SongListCell.swift */; };
-		60553F952D3B528A00BAAD7F /* AddPlayListViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60553F1C2D3B528A00BAAD7F /* AddPlayListViewModel.swift */; };
-		60553F962D3B528A00BAAD7F /* BaseDataModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60553F102D3B528A00BAAD7F /* BaseDataModel.swift */; };
-		60553F972D3B528A00BAAD7F /* PlayDetailPlaceHolderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60553F4C2D3B528A00BAAD7F /* PlayDetailPlaceHolderView.swift */; };
-		60553F982D3B528A00BAAD7F /* SJIJKMediaPlaybackController.m in Sources */ = {isa = PBXBuildFile; fileRef = 60553F0A2D3B528A00BAAD7F /* SJIJKMediaPlaybackController.m */; };
-		60553F992D3B528A00BAAD7F /* FilterBarViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60553F2D2D3B528A00BAAD7F /* FilterBarViewModel.swift */; };
-		60553F9A2D3B528A00BAAD7F /* PlayListManageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60553F182D3B528A00BAAD7F /* PlayListManageView.swift */; };
-		60553F9B2D3B528A00BAAD7F /* LWSearchBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60553F3F2D3B528A00BAAD7F /* LWSearchBar.swift */; };
-		60553F9C2D3B528A00BAAD7F /* BubbleMenuView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60553F6D2D3B528A00BAAD7F /* BubbleMenuView.swift */; };
-		60553F9D2D3B528A00BAAD7F /* SongListViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60553F5C2D3B528A00BAAD7F /* SongListViewModel.swift */; };
-		60553F9E2D3B528A00BAAD7F /* SearchResultStateView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60553F112D3B528A00BAAD7F /* SearchResultStateView.swift */; };
-		60553F9F2D3B528A00BAAD7F /* FilterBarView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60553F2E2D3B528A00BAAD7F /* FilterBarView.swift */; };
-		60553FA02D3B528A00BAAD7F /* SongListViewController+Target.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60553F5F2D3B528A00BAAD7F /* SongListViewController+Target.swift */; };
-		60553FA12D3B528A00BAAD7F /* ToastView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60553F6B2D3B528A00BAAD7F /* ToastView.swift */; };
-		60553FA22D3B528A00BAAD7F /* SongListViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60553F5E2D3B528A00BAAD7F /* SongListViewController.swift */; };
-		60553FA32D3B528A00BAAD7F /* PlayListTopItemView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60553F172D3B528A00BAAD7F /* PlayListTopItemView.swift */; };
-		60553FA42D3B528A00BAAD7F /* VipTagView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60553F332D3B528A00BAAD7F /* VipTagView.swift */; };
-		60553FA52D3B528A00BAAD7F /* CWTopCustomButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60553F562D3B528A00BAAD7F /* CWTopCustomButton.swift */; };
-		60553FA62D3B528A00BAAD7F /* RelateSeachCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60553F432D3B528A00BAAD7F /* RelateSeachCell.swift */; };
-		60553FA72D3B528A00BAAD7F /* PlaylistViewController+Ext.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60553F212D3B528A00BAAD7F /* PlaylistViewController+Ext.swift */; };
-		60553FA82D3B528A00BAAD7F /* CWOperateItemView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60553F372D3B528A00BAAD7F /* CWOperateItemView.swift */; };
-		60553FA92D3B528A00BAAD7F /* CustomTextField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60553F412D3B528A00BAAD7F /* CustomTextField.swift */; };
-		60553FAA2D3B528A00BAAD7F /* CWOperateButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60553F382D3B528A00BAAD7F /* CWOperateButton.swift */; };
-		60553FAB2D3B528A00BAAD7F /* PlayListViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60553F1A2D3B528A00BAAD7F /* PlayListViewModel.swift */; };
-		60553FAC2D3B528A00BAAD7F /* TagListView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60553F422D3B528A00BAAD7F /* TagListView.swift */; };
-		60553FAD2D3B528A00BAAD7F /* ImageTextControl.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60553F642D3B528A00BAAD7F /* ImageTextControl.swift */; };
-		60553FAE2D3B528A00BAAD7F /* CWProgressView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60553F322D3B528A00BAAD7F /* CWProgressView.swift */; };
-		60553FAF2D3B528A00BAAD7F /* TipsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60553F672D3B528A00BAAD7F /* TipsView.swift */; };
-		60553FB02D3B528A00BAAD7F /* PlayMiniBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60553F652D3B528A00BAAD7F /* PlayMiniBar.swift */; };
-		60553FB12D3B528A00BAAD7F /* SongDownloadCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60553F552D3B528A00BAAD7F /* SongDownloadCell.swift */; };
-		60553FB22D3B528A00BAAD7F /* LocalSearchViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60553F3D2D3B528A00BAAD7F /* LocalSearchViewModel.swift */; };
-		60553FB32D3B528A00BAAD7F /* SortMenuViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60553F2F2D3B528A00BAAD7F /* SortMenuViewController.swift */; };
-		60553FB42D3B528A00BAAD7F /* ImportFilesManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60553F2A2D3B528A00BAAD7F /* ImportFilesManager.swift */; };
-		60553FB52D3B528A00BAAD7F /* PlayButtonView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60553F492D3B528A00BAAD7F /* PlayButtonView.swift */; };
-		60553FB62D3B528A00BAAD7F /* PlayDetailListViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60553F152D3B528A00BAAD7F /* PlayDetailListViewCell.swift */; };
-		60553FB72D3B528A00BAAD7F /* FilterBarViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60553F2C2D3B528A00BAAD7F /* FilterBarViewController.swift */; };
-		60553FB82D3B528A00BAAD7F /* SongListTopView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60553F592D3B528A00BAAD7F /* SongListTopView.swift */; };
-		60553FB92D3B528A00BAAD7F /* CDView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60553F572D3B528A00BAAD7F /* CDView.swift */; };
-		60553FBA2D3B528A00BAAD7F /* NotifactionKey.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60553F662D3B528A00BAAD7F /* NotifactionKey.swift */; };
-		60553FBB2D3B528A00BAAD7F /* PlayListAddCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60553F142D3B528A00BAAD7F /* PlayListAddCell.swift */; };
-		60553FBC2D3B528A00BAAD7F /* SearchOnlineViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60553F452D3B528A00BAAD7F /* SearchOnlineViewController.swift */; };
-		60553FBD2D3B528A00BAAD7F /* SpacedButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60553F6F2D3B528A00BAAD7F /* SpacedButton.swift */; };
-		60553FBE2D3B528A00BAAD7F /* BasePresentViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60553F622D3B528A00BAAD7F /* BasePresentViewController.swift */; };
-		60553FBF2D3B528A00BAAD7F /* PlayListCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60553F132D3B528A00BAAD7F /* PlayListCell.swift */; };
-		60553FC12D3B528A00BAAD7F /* MusicSearchBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60553F6C2D3B528A00BAAD7F /* MusicSearchBar.swift */; };
-		60553FC22D3B528A00BAAD7F /* PlayerManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60553F522D3B528A00BAAD7F /* PlayerManager.swift */; };
-		60553FC32D3B528A00BAAD7F /* LocalSearchViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60553F462D3B528A00BAAD7F /* LocalSearchViewController.swift */; };
-		60553FC42D3B528A00BAAD7F /* IJKPlayer.md in Resources */ = {isa = PBXBuildFile; fileRef = 60553F082D3B528A00BAAD7F /* IJKPlayer.md */; };
-		60553FD02D3B54A400BAAD7F /* LWNavigationBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60553FC72D3B54A400BAAD7F /* LWNavigationBar.swift */; };
-		60553FD22D3B54A400BAAD7F /* GradientButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60553FCA2D3B54A400BAAD7F /* GradientButton.swift */; };
-		60553FD42D3B54A400BAAD7F /* LWBaseViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60553FC82D3B54A400BAAD7F /* LWBaseViewController.swift */; };
-		60553FD62D3B54A400BAAD7F /* SaveSuccessTipsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60553FCB2D3B54A400BAAD7F /* SaveSuccessTipsView.swift */; };
-		60553FD72D3B54A400BAAD7F /* GradientText.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60553FCD2D3B54A400BAAD7F /* GradientText.swift */; };
-		60553FD82D3B54A400BAAD7F /* LWBaseNavigationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60553FC92D3B54A400BAAD7F /* LWBaseNavigationController.swift */; };
-		60553FD92D3B54A400BAAD7F /* GradientBackgroundModifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60553FCE2D3B54A400BAAD7F /* GradientBackgroundModifier.swift */; };
-		60553FDB2D3B7CC600BAAD7F /* FitManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60553FDA2D3B7CC600BAAD7F /* FitManager.swift */; };
+		6039010D2DF92BD90096551E /* LWBaseNavigationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 603901092DF92BD90096551E /* LWBaseNavigationController.swift */; };
+		6039010E2DF92BD90096551E /* LWNavigationBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6039010B2DF92BD90096551E /* LWNavigationBar.swift */; };
+		6039010F2DF92BD90096551E /* LWBaseViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6039010A2DF92BD90096551E /* LWBaseViewController.swift */; };
+		603901102DF92BD90096551E /* LWSearchBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6039010C2DF92BD90096551E /* LWSearchBar.swift */; };
+		603901142DF92C860096551E /* SpacedButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 603901112DF92C860096551E /* SpacedButton.swift */; };
+		6039011A2DF9367B0096551E /* Flash-old-Tim.png in Resources */ = {isa = PBXBuildFile; fileRef = 603901162DF9367B0096551E /* Flash-old-Tim.png */; };
 		60553FDD2D3B84E700BAAD7F /* UIScrollView+Ext.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60553FDC2D3B84E700BAAD7F /* UIScrollView+Ext.swift */; };
 		60553FDD2D3B84E700BAAD7F /* UIScrollView+Ext.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60553FDC2D3B84E700BAAD7F /* UIScrollView+Ext.swift */; };
 		60553FDF2D3B850C00BAAD7F /* TimeInterval+Ext.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60553FDE2D3B850C00BAAD7F /* TimeInterval+Ext.swift */; };
 		60553FDF2D3B850C00BAAD7F /* TimeInterval+Ext.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60553FDE2D3B850C00BAAD7F /* TimeInterval+Ext.swift */; };
-		60553FE32D3DF12200BAAD7F /* CustomSegementItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60553FE22D3DF12200BAAD7F /* CustomSegementItem.swift */; };
-		606372D82D545E6C005C82CF /* Example Music.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = 606372D72D545E6C005C82CF /* Example Music.mp3 */; };
-		606372DA2D545F0D005C82CF /* ExampleIniter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 606372D92D545F0D005C82CF /* ExampleIniter.swift */; };
-		606372DD2D54999C005C82CF /* ADScene.swift in Sources */ = {isa = PBXBuildFile; fileRef = 606372DC2D54999C005C82CF /* ADScene.swift */; };
-		606372DF2D54BBB5005C82CF /* AppConfig.swift in Sources */ = {isa = PBXBuildFile; fileRef = 606372DE2D54BBB5005C82CF /* AppConfig.swift */; };
-		606372E12D54BC37005C82CF /* GoogleMobileAdsConsentManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 606372E02D54BC37005C82CF /* GoogleMobileAdsConsentManager.swift */; };
-		606372E32D55A995005C82CF /* ADLoadingViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 606372E22D55A995005C82CF /* ADLoadingViewController.swift */; };
-		606372E52D55BAB8005C82CF /* GuideBubbleView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 606372E42D55BAB8005C82CF /* GuideBubbleView.swift */; };
-		606372E72D5705F4005C82CF /* MusicPlaylistContainerViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 606372E62D5705F4005C82CF /* MusicPlaylistContainerViewController.swift */; };
 		609B6EA52D6F1221007942D4 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 609B6EA32D6F1221007942D4 /* Localizable.strings */; };
 		609B6EA52D6F1221007942D4 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 609B6EA32D6F1221007942D4 /* Localizable.strings */; };
-		60F82C0F2D43295100FFB08D /* MusicHomeContainerViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60F82C0E2D43295100FFB08D /* MusicHomeContainerViewController.swift */; };
-		60F82C112D43298800FFB08D /* MusicContainerViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60F82C102D43298800FFB08D /* MusicContainerViewModel.swift */; };
 		A81CA4652D15685F00A3AAC8 /* TSLaunchVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = A81CA4642D15685D00A3AAC8 /* TSLaunchVC.swift */; };
 		A81CA4652D15685F00A3AAC8 /* TSLaunchVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = A81CA4642D15685D00A3AAC8 /* TSLaunchVC.swift */; };
 		A81CA4692D156AB600A3AAC8 /* TSBaseVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = A81CA4682D156AAB00A3AAC8 /* TSBaseVC.swift */; };
 		A81CA4692D156AB600A3AAC8 /* TSBaseVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = A81CA4682D156AAB00A3AAC8 /* TSBaseVC.swift */; };
 		A81CA46B2D156BDC00A3AAC8 /* TSBaseNavigationC.swift in Sources */ = {isa = PBXBuildFile; fileRef = A81CA46A2D156BC600A3AAC8 /* TSBaseNavigationC.swift */; };
 		A81CA46B2D156BDC00A3AAC8 /* TSBaseNavigationC.swift in Sources */ = {isa = PBXBuildFile; fileRef = A81CA46A2D156BC600A3AAC8 /* TSBaseNavigationC.swift */; };
@@ -213,111 +118,14 @@
 /* End PBXBuildFile section */
 /* End PBXBuildFile section */
 
 
 /* Begin PBXFileReference section */
 /* Begin PBXFileReference section */
-		60553F032D3B528A00BAAD7F /* SJIJKMediaPlayer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SJIJKMediaPlayer.h; sourceTree = "<group>"; };
-		60553F042D3B528A00BAAD7F /* SJIJKMediaPlayer.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SJIJKMediaPlayer.m; sourceTree = "<group>"; };
-		60553F052D3B528A00BAAD7F /* SJIJKMediaPlayerLayerView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SJIJKMediaPlayerLayerView.h; sourceTree = "<group>"; };
-		60553F062D3B528A00BAAD7F /* SJIJKMediaPlayerLayerView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SJIJKMediaPlayerLayerView.m; sourceTree = "<group>"; };
-		60553F082D3B528A00BAAD7F /* IJKPlayer.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = IJKPlayer.md; sourceTree = "<group>"; };
-		60553F092D3B528A00BAAD7F /* SJIJKMediaPlaybackController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SJIJKMediaPlaybackController.h; sourceTree = "<group>"; };
-		60553F0A2D3B528A00BAAD7F /* SJIJKMediaPlaybackController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SJIJKMediaPlaybackController.m; sourceTree = "<group>"; };
-		60553F0B2D3B528A00BAAD7F /* TSAvatar-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "TSAvatar-Header.h"; sourceTree = "<group>"; };
-		60553F0E2D3B528A00BAAD7F /* SearchResultViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchResultViewController.swift; sourceTree = "<group>"; };
-		60553F0F2D3B528A00BAAD7F /* SearchResultViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchResultViewModel.swift; sourceTree = "<group>"; };
-		60553F102D3B528A00BAAD7F /* BaseDataModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BaseDataModel.swift; sourceTree = "<group>"; };
-		60553F112D3B528A00BAAD7F /* SearchResultStateView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchResultStateView.swift; sourceTree = "<group>"; };
-		60553F132D3B528A00BAAD7F /* PlayListCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlayListCell.swift; sourceTree = "<group>"; };
-		60553F142D3B528A00BAAD7F /* PlayListAddCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlayListAddCell.swift; sourceTree = "<group>"; };
-		60553F152D3B528A00BAAD7F /* PlayDetailListViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlayDetailListViewCell.swift; sourceTree = "<group>"; };
-		60553F162D3B528A00BAAD7F /* SongListBottomView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SongListBottomView.swift; sourceTree = "<group>"; };
-		60553F172D3B528A00BAAD7F /* PlayListTopItemView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlayListTopItemView.swift; sourceTree = "<group>"; };
-		60553F182D3B528A00BAAD7F /* PlayListManageView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlayListManageView.swift; sourceTree = "<group>"; };
-		60553F1A2D3B528A00BAAD7F /* PlayListViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlayListViewModel.swift; sourceTree = "<group>"; };
-		60553F1B2D3B528A00BAAD7F /* PlayListDetaiViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlayListDetaiViewModel.swift; sourceTree = "<group>"; };
-		60553F1C2D3B528A00BAAD7F /* AddPlayListViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddPlayListViewModel.swift; sourceTree = "<group>"; };
-		60553F1D2D3B528A00BAAD7F /* SongListManageViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SongListManageViewModel.swift; sourceTree = "<group>"; };
-		60553F1E2D3B528A00BAAD7F /* PlayDetailListViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlayDetailListViewModel.swift; sourceTree = "<group>"; };
-		60553F202D3B528A00BAAD7F /* PlaylistViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlaylistViewController.swift; sourceTree = "<group>"; };
-		60553F212D3B528A00BAAD7F /* PlaylistViewController+Ext.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "PlaylistViewController+Ext.swift"; sourceTree = "<group>"; };
-		60553F222D3B528A00BAAD7F /* PlaylistDetailViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlaylistDetailViewController.swift; sourceTree = "<group>"; };
-		60553F232D3B528A00BAAD7F /* AddPlayListViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddPlayListViewController.swift; sourceTree = "<group>"; };
-		60553F242D3B528A00BAAD7F /* PlayDetailListViewContoller.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlayDetailListViewContoller.swift; sourceTree = "<group>"; };
-		60553F282D3B528A00BAAD7F /* Consts.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Consts.swift; sourceTree = "<group>"; };
-		60553F2A2D3B528A00BAAD7F /* ImportFilesManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ImportFilesManager.swift; sourceTree = "<group>"; };
-		60553F2C2D3B528A00BAAD7F /* FilterBarViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FilterBarViewController.swift; sourceTree = "<group>"; };
-		60553F2D2D3B528A00BAAD7F /* FilterBarViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FilterBarViewModel.swift; sourceTree = "<group>"; };
-		60553F2E2D3B528A00BAAD7F /* FilterBarView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FilterBarView.swift; sourceTree = "<group>"; };
-		60553F2F2D3B528A00BAAD7F /* SortMenuViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SortMenuViewController.swift; sourceTree = "<group>"; };
-		60553F302D3B528A00BAAD7F /* DownloadButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DownloadButton.swift; sourceTree = "<group>"; };
-		60553F312D3B528A00BAAD7F /* CWCustomProgressView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CWCustomProgressView.swift; sourceTree = "<group>"; };
-		60553F322D3B528A00BAAD7F /* CWProgressView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CWProgressView.swift; sourceTree = "<group>"; };
-		60553F332D3B528A00BAAD7F /* VipTagView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VipTagView.swift; sourceTree = "<group>"; };
-		60553F342D3B528A00BAAD7F /* CWLoadingView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CWLoadingView.swift; sourceTree = "<group>"; };
-		60553F352D3B528A00BAAD7F /* CWOperateViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CWOperateViewController.swift; sourceTree = "<group>"; };
-		60553F362D3B528A00BAAD7F /* CWOperateViewController+Ext.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "CWOperateViewController+Ext.swift"; sourceTree = "<group>"; };
-		60553F372D3B528A00BAAD7F /* CWOperateItemView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CWOperateItemView.swift; sourceTree = "<group>"; };
-		60553F382D3B528A00BAAD7F /* CWOperateButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CWOperateButton.swift; sourceTree = "<group>"; };
-		60553F392D3B528A00BAAD7F /* CWMutiSelectOpeateView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CWMutiSelectOpeateView.swift; sourceTree = "<group>"; };
-		60553F3A2D3B528A00BAAD7F /* OperateTopView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OperateTopView.swift; sourceTree = "<group>"; };
-		60553F3C2D3B528A00BAAD7F /* SearchViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchViewModel.swift; sourceTree = "<group>"; };
-		60553F3D2D3B528A00BAAD7F /* LocalSearchViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocalSearchViewModel.swift; sourceTree = "<group>"; };
-		60553F3F2D3B528A00BAAD7F /* LWSearchBar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LWSearchBar.swift; sourceTree = "<group>"; };
-		60553F402D3B528A00BAAD7F /* CWSearchTextBar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CWSearchTextBar.swift; sourceTree = "<group>"; };
-		60553F412D3B528A00BAAD7F /* CustomTextField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomTextField.swift; sourceTree = "<group>"; };
-		60553F422D3B528A00BAAD7F /* TagListView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TagListView.swift; sourceTree = "<group>"; };
-		60553F432D3B528A00BAAD7F /* RelateSeachCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RelateSeachCell.swift; sourceTree = "<group>"; };
-		60553F452D3B528A00BAAD7F /* SearchOnlineViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchOnlineViewController.swift; sourceTree = "<group>"; };
-		60553F462D3B528A00BAAD7F /* LocalSearchViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocalSearchViewController.swift; sourceTree = "<group>"; };
-		60553F492D3B528A00BAAD7F /* PlayButtonView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlayButtonView.swift; sourceTree = "<group>"; };
-		60553F4A2D3B528A00BAAD7F /* PlayDetailTopView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlayDetailTopView.swift; sourceTree = "<group>"; };
-		60553F4B2D3B528A00BAAD7F /* PlayDetailControlView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlayDetailControlView.swift; sourceTree = "<group>"; };
-		60553F4C2D3B528A00BAAD7F /* PlayDetailPlaceHolderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlayDetailPlaceHolderView.swift; sourceTree = "<group>"; };
-		60553F4E2D3B528A00BAAD7F /* SleepTimeViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SleepTimeViewController.swift; sourceTree = "<group>"; };
-		60553F4F2D3B528A00BAAD7F /* PlayDetailViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlayDetailViewController.swift; sourceTree = "<group>"; };
-		60553F502D3B528A00BAAD7F /* PlayDetailViewController+Ext.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "PlayDetailViewController+Ext.swift"; sourceTree = "<group>"; };
-		60553F522D3B528A00BAAD7F /* PlayerManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlayerManager.swift; sourceTree = "<group>"; };
-		60553F542D3B528A00BAAD7F /* SongListCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SongListCell.swift; sourceTree = "<group>"; };
-		60553F552D3B528A00BAAD7F /* SongDownloadCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SongDownloadCell.swift; sourceTree = "<group>"; };
-		60553F562D3B528A00BAAD7F /* CWTopCustomButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CWTopCustomButton.swift; sourceTree = "<group>"; };
-		60553F572D3B528A00BAAD7F /* CDView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CDView.swift; sourceTree = "<group>"; };
-		60553F582D3B528A00BAAD7F /* PlaylistTopView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlaylistTopView.swift; sourceTree = "<group>"; };
-		60553F592D3B528A00BAAD7F /* SongListTopView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SongListTopView.swift; sourceTree = "<group>"; };
-		60553F5B2D3B528A00BAAD7F /* SongDownloadCellViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SongDownloadCellViewModel.swift; sourceTree = "<group>"; };
-		60553F5C2D3B528A00BAAD7F /* SongListViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SongListViewModel.swift; sourceTree = "<group>"; };
-		60553F5E2D3B528A00BAAD7F /* SongListViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SongListViewController.swift; sourceTree = "<group>"; };
-		60553F5F2D3B528A00BAAD7F /* SongListViewController+Target.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "SongListViewController+Target.swift"; sourceTree = "<group>"; };
-		60553F622D3B528A00BAAD7F /* BasePresentViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BasePresentViewController.swift; sourceTree = "<group>"; };
-		60553F632D3B528A00BAAD7F /* ManageMenuAlertView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ManageMenuAlertView.swift; sourceTree = "<group>"; };
-		60553F642D3B528A00BAAD7F /* ImageTextControl.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ImageTextControl.swift; sourceTree = "<group>"; };
-		60553F652D3B528A00BAAD7F /* PlayMiniBar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlayMiniBar.swift; sourceTree = "<group>"; };
-		60553F662D3B528A00BAAD7F /* NotifactionKey.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotifactionKey.swift; sourceTree = "<group>"; };
-		60553F672D3B528A00BAAD7F /* TipsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TipsView.swift; sourceTree = "<group>"; };
-		60553F682D3B528A00BAAD7F /* THUD.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = THUD.swift; sourceTree = "<group>"; };
-		60553F692D3B528A00BAAD7F /* THUDProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = THUDProtocol.swift; sourceTree = "<group>"; };
-		60553F6A2D3B528A00BAAD7F /* THUD+CW.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "THUD+CW.swift"; sourceTree = "<group>"; };
-		60553F6B2D3B528A00BAAD7F /* ToastView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ToastView.swift; sourceTree = "<group>"; };
-		60553F6C2D3B528A00BAAD7F /* MusicSearchBar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MusicSearchBar.swift; sourceTree = "<group>"; };
-		60553F6D2D3B528A00BAAD7F /* BubbleMenuView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BubbleMenuView.swift; sourceTree = "<group>"; };
-		60553F6E2D3B528A00BAAD7F /* MusicEmptyView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MusicEmptyView.swift; sourceTree = "<group>"; };
-		60553F6F2D3B528A00BAAD7F /* SpacedButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SpacedButton.swift; sourceTree = "<group>"; };
-		60553FC72D3B54A400BAAD7F /* LWNavigationBar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LWNavigationBar.swift; sourceTree = "<group>"; };
-		60553FC82D3B54A400BAAD7F /* LWBaseViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LWBaseViewController.swift; sourceTree = "<group>"; };
-		60553FC92D3B54A400BAAD7F /* LWBaseNavigationController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LWBaseNavigationController.swift; sourceTree = "<group>"; };
-		60553FCA2D3B54A400BAAD7F /* GradientButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GradientButton.swift; sourceTree = "<group>"; };
-		60553FCB2D3B54A400BAAD7F /* SaveSuccessTipsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SaveSuccessTipsView.swift; sourceTree = "<group>"; };
-		60553FCD2D3B54A400BAAD7F /* GradientText.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GradientText.swift; sourceTree = "<group>"; };
-		60553FCE2D3B54A400BAAD7F /* GradientBackgroundModifier.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GradientBackgroundModifier.swift; sourceTree = "<group>"; };
-		60553FDA2D3B7CC600BAAD7F /* FitManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FitManager.swift; sourceTree = "<group>"; };
+		603901092DF92BD90096551E /* LWBaseNavigationController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LWBaseNavigationController.swift; sourceTree = "<group>"; };
+		6039010A2DF92BD90096551E /* LWBaseViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LWBaseViewController.swift; sourceTree = "<group>"; };
+		6039010B2DF92BD90096551E /* LWNavigationBar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LWNavigationBar.swift; sourceTree = "<group>"; };
+		6039010C2DF92BD90096551E /* LWSearchBar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LWSearchBar.swift; sourceTree = "<group>"; };
+		603901112DF92C860096551E /* SpacedButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SpacedButton.swift; sourceTree = "<group>"; };
+		603901162DF9367B0096551E /* Flash-old-Tim.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Flash-old-Tim.png"; sourceTree = "<group>"; };
 		60553FDC2D3B84E700BAAD7F /* UIScrollView+Ext.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIScrollView+Ext.swift"; sourceTree = "<group>"; };
 		60553FDC2D3B84E700BAAD7F /* UIScrollView+Ext.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIScrollView+Ext.swift"; sourceTree = "<group>"; };
 		60553FDE2D3B850C00BAAD7F /* TimeInterval+Ext.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "TimeInterval+Ext.swift"; sourceTree = "<group>"; };
 		60553FDE2D3B850C00BAAD7F /* TimeInterval+Ext.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "TimeInterval+Ext.swift"; sourceTree = "<group>"; };
-		60553FE22D3DF12200BAAD7F /* CustomSegementItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomSegementItem.swift; sourceTree = "<group>"; };
-		606372D72D545E6C005C82CF /* Example Music.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; path = "Example Music.mp3"; sourceTree = "<group>"; };
-		606372D92D545F0D005C82CF /* ExampleIniter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExampleIniter.swift; sourceTree = "<group>"; };
-		606372DC2D54999C005C82CF /* ADScene.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ADScene.swift; sourceTree = "<group>"; };
-		606372DE2D54BBB5005C82CF /* AppConfig.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppConfig.swift; sourceTree = "<group>"; };
-		606372E02D54BC37005C82CF /* GoogleMobileAdsConsentManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GoogleMobileAdsConsentManager.swift; sourceTree = "<group>"; };
-		606372E22D55A995005C82CF /* ADLoadingViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ADLoadingViewController.swift; sourceTree = "<group>"; };
-		606372E42D55BAB8005C82CF /* GuideBubbleView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GuideBubbleView.swift; sourceTree = "<group>"; };
-		606372E62D5705F4005C82CF /* MusicPlaylistContainerViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MusicPlaylistContainerViewController.swift; sourceTree = "<group>"; };
 		609B6E9F2D6F11D0007942D4 /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/LaunchScreen.strings; sourceTree = "<group>"; };
 		609B6E9F2D6F11D0007942D4 /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/LaunchScreen.strings; sourceTree = "<group>"; };
 		609B6EA02D6F11D5007942D4 /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/LaunchScreen.strings; sourceTree = "<group>"; };
 		609B6EA02D6F11D5007942D4 /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/LaunchScreen.strings; sourceTree = "<group>"; };
 		609B6EA12D6F11E0007942D4 /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/LaunchScreen.strings; sourceTree = "<group>"; };
 		609B6EA12D6F11E0007942D4 /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/LaunchScreen.strings; sourceTree = "<group>"; };
@@ -327,8 +135,6 @@
 		609B6EA72D6F1230007942D4 /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/Localizable.strings; sourceTree = "<group>"; };
 		609B6EA72D6F1230007942D4 /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/Localizable.strings; sourceTree = "<group>"; };
 		609B6EA82D6F1231007942D4 /* pt-PT */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "pt-PT"; path = "pt-PT.lproj/Localizable.strings"; sourceTree = "<group>"; };
 		609B6EA82D6F1231007942D4 /* pt-PT */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "pt-PT"; path = "pt-PT.lproj/Localizable.strings"; sourceTree = "<group>"; };
 		609B6EA92D6F1231007942D4 /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/Localizable.strings; sourceTree = "<group>"; };
 		609B6EA92D6F1231007942D4 /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/Localizable.strings; sourceTree = "<group>"; };
-		60F82C0E2D43295100FFB08D /* MusicHomeContainerViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MusicHomeContainerViewController.swift; sourceTree = "<group>"; };
-		60F82C102D43298800FFB08D /* MusicContainerViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MusicContainerViewModel.swift; sourceTree = "<group>"; };
 		71E5F623537702A8306DF3C8 /* Pods-TSLiveWallpaper.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TSLiveWallpaper.release.xcconfig"; path = "Target Support Files/Pods-TSLiveWallpaper/Pods-TSLiveWallpaper.release.xcconfig"; sourceTree = "<group>"; };
 		71E5F623537702A8306DF3C8 /* Pods-TSLiveWallpaper.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TSLiveWallpaper.release.xcconfig"; path = "Target Support Files/Pods-TSLiveWallpaper/Pods-TSLiveWallpaper.release.xcconfig"; sourceTree = "<group>"; };
 		A81CA4642D15685D00A3AAC8 /* TSLaunchVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TSLaunchVC.swift; sourceTree = "<group>"; };
 		A81CA4642D15685D00A3AAC8 /* TSLaunchVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TSLaunchVC.swift; sourceTree = "<group>"; };
 		A81CA4682D156AAB00A3AAC8 /* TSBaseVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TSBaseVC.swift; sourceTree = "<group>"; };
 		A81CA4682D156AAB00A3AAC8 /* TSBaseVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TSBaseVC.swift; sourceTree = "<group>"; };
@@ -457,324 +263,6 @@
 			path = Pods;
 			path = Pods;
 			sourceTree = "<group>";
 			sourceTree = "<group>";
 		};
 		};
-		60553F022D3B4DF800BAAD7F /* TSMusic */ = {
-			isa = PBXGroup;
-			children = (
-				60553FCF2D3B54A400BAAD7F /* MusicBase */,
-				60553F0D2D3B528A00BAAD7F /* OC */,
-				60553F122D3B528A00BAAD7F /* SearchResult */,
-				60553F272D3B528A00BAAD7F /* PlayList */,
-				60553F292D3B528A00BAAD7F /* Consts */,
-				60553F2B2D3B528A00BAAD7F /* Import */,
-				60553F3B2D3B528A00BAAD7F /* Helper */,
-				60553F482D3B528A00BAAD7F /* Search */,
-				60553F532D3B528A00BAAD7F /* Detail */,
-				60553F612D3B528A00BAAD7F /* List */,
-				60553F702D3B528A00BAAD7F /* Custom */,
-			);
-			path = TSMusic;
-			sourceTree = "<group>";
-		};
-		60553F072D3B528A00BAAD7F /* Core */ = {
-			isa = PBXGroup;
-			children = (
-				60553F032D3B528A00BAAD7F /* SJIJKMediaPlayer.h */,
-				60553F042D3B528A00BAAD7F /* SJIJKMediaPlayer.m */,
-				60553F052D3B528A00BAAD7F /* SJIJKMediaPlayerLayerView.h */,
-				60553F062D3B528A00BAAD7F /* SJIJKMediaPlayerLayerView.m */,
-			);
-			path = Core;
-			sourceTree = "<group>";
-		};
-		60553F0C2D3B528A00BAAD7F /* IJKPlayer */ = {
-			isa = PBXGroup;
-			children = (
-				60553F072D3B528A00BAAD7F /* Core */,
-				60553F082D3B528A00BAAD7F /* IJKPlayer.md */,
-				60553F092D3B528A00BAAD7F /* SJIJKMediaPlaybackController.h */,
-				60553F0A2D3B528A00BAAD7F /* SJIJKMediaPlaybackController.m */,
-				60553F0B2D3B528A00BAAD7F /* TSAvatar-Header.h */,
-			);
-			path = IJKPlayer;
-			sourceTree = "<group>";
-		};
-		60553F0D2D3B528A00BAAD7F /* OC */ = {
-			isa = PBXGroup;
-			children = (
-				60553F0C2D3B528A00BAAD7F /* IJKPlayer */,
-			);
-			path = OC;
-			sourceTree = "<group>";
-		};
-		60553F122D3B528A00BAAD7F /* SearchResult */ = {
-			isa = PBXGroup;
-			children = (
-				60553F0E2D3B528A00BAAD7F /* SearchResultViewController.swift */,
-				60553F0F2D3B528A00BAAD7F /* SearchResultViewModel.swift */,
-				60553F102D3B528A00BAAD7F /* BaseDataModel.swift */,
-				60553F112D3B528A00BAAD7F /* SearchResultStateView.swift */,
-			);
-			path = SearchResult;
-			sourceTree = "<group>";
-		};
-		60553F192D3B528A00BAAD7F /* Views */ = {
-			isa = PBXGroup;
-			children = (
-				60553F132D3B528A00BAAD7F /* PlayListCell.swift */,
-				60553F142D3B528A00BAAD7F /* PlayListAddCell.swift */,
-				60553F152D3B528A00BAAD7F /* PlayDetailListViewCell.swift */,
-				60553F162D3B528A00BAAD7F /* SongListBottomView.swift */,
-				60553F172D3B528A00BAAD7F /* PlayListTopItemView.swift */,
-				60553F182D3B528A00BAAD7F /* PlayListManageView.swift */,
-			);
-			path = Views;
-			sourceTree = "<group>";
-		};
-		60553F1F2D3B528A00BAAD7F /* ViewModel */ = {
-			isa = PBXGroup;
-			children = (
-				60553F1A2D3B528A00BAAD7F /* PlayListViewModel.swift */,
-				60553F1B2D3B528A00BAAD7F /* PlayListDetaiViewModel.swift */,
-				60553F1C2D3B528A00BAAD7F /* AddPlayListViewModel.swift */,
-				60553F1D2D3B528A00BAAD7F /* SongListManageViewModel.swift */,
-				60553F1E2D3B528A00BAAD7F /* PlayDetailListViewModel.swift */,
-			);
-			path = ViewModel;
-			sourceTree = "<group>";
-		};
-		60553F262D3B528A00BAAD7F /* Controller */ = {
-			isa = PBXGroup;
-			children = (
-				60553F202D3B528A00BAAD7F /* PlaylistViewController.swift */,
-				60553F212D3B528A00BAAD7F /* PlaylistViewController+Ext.swift */,
-				60553F222D3B528A00BAAD7F /* PlaylistDetailViewController.swift */,
-				60553F232D3B528A00BAAD7F /* AddPlayListViewController.swift */,
-				60553F242D3B528A00BAAD7F /* PlayDetailListViewContoller.swift */,
-			);
-			path = Controller;
-			sourceTree = "<group>";
-		};
-		60553F272D3B528A00BAAD7F /* PlayList */ = {
-			isa = PBXGroup;
-			children = (
-				60553F192D3B528A00BAAD7F /* Views */,
-				60553F1F2D3B528A00BAAD7F /* ViewModel */,
-				60553F262D3B528A00BAAD7F /* Controller */,
-			);
-			path = PlayList;
-			sourceTree = "<group>";
-		};
-		60553F292D3B528A00BAAD7F /* Consts */ = {
-			isa = PBXGroup;
-			children = (
-				60553F282D3B528A00BAAD7F /* Consts.swift */,
-			);
-			path = Consts;
-			sourceTree = "<group>";
-		};
-		60553F2B2D3B528A00BAAD7F /* Import */ = {
-			isa = PBXGroup;
-			children = (
-				60553F2A2D3B528A00BAAD7F /* ImportFilesManager.swift */,
-			);
-			path = Import;
-			sourceTree = "<group>";
-		};
-		60553F3B2D3B528A00BAAD7F /* Helper */ = {
-			isa = PBXGroup;
-			children = (
-				60553F2C2D3B528A00BAAD7F /* FilterBarViewController.swift */,
-				60553F2D2D3B528A00BAAD7F /* FilterBarViewModel.swift */,
-				60553F2E2D3B528A00BAAD7F /* FilterBarView.swift */,
-				606372E42D55BAB8005C82CF /* GuideBubbleView.swift */,
-				60553F2F2D3B528A00BAAD7F /* SortMenuViewController.swift */,
-				60553F302D3B528A00BAAD7F /* DownloadButton.swift */,
-				60553F312D3B528A00BAAD7F /* CWCustomProgressView.swift */,
-				60553F322D3B528A00BAAD7F /* CWProgressView.swift */,
-				60553F332D3B528A00BAAD7F /* VipTagView.swift */,
-				60553F342D3B528A00BAAD7F /* CWLoadingView.swift */,
-				60553F352D3B528A00BAAD7F /* CWOperateViewController.swift */,
-				60553F362D3B528A00BAAD7F /* CWOperateViewController+Ext.swift */,
-				60553F372D3B528A00BAAD7F /* CWOperateItemView.swift */,
-				60553F382D3B528A00BAAD7F /* CWOperateButton.swift */,
-				60553F392D3B528A00BAAD7F /* CWMutiSelectOpeateView.swift */,
-				60553F3A2D3B528A00BAAD7F /* OperateTopView.swift */,
-			);
-			path = Helper;
-			sourceTree = "<group>";
-		};
-		60553F3E2D3B528A00BAAD7F /* ViewModel */ = {
-			isa = PBXGroup;
-			children = (
-				60553F3C2D3B528A00BAAD7F /* SearchViewModel.swift */,
-				60553F3D2D3B528A00BAAD7F /* LocalSearchViewModel.swift */,
-			);
-			path = ViewModel;
-			sourceTree = "<group>";
-		};
-		60553F442D3B528A00BAAD7F /* Views */ = {
-			isa = PBXGroup;
-			children = (
-				60553F3F2D3B528A00BAAD7F /* LWSearchBar.swift */,
-				60553F402D3B528A00BAAD7F /* CWSearchTextBar.swift */,
-				60553F412D3B528A00BAAD7F /* CustomTextField.swift */,
-				60553F422D3B528A00BAAD7F /* TagListView.swift */,
-				60553F432D3B528A00BAAD7F /* RelateSeachCell.swift */,
-			);
-			path = Views;
-			sourceTree = "<group>";
-		};
-		60553F472D3B528A00BAAD7F /* Controller */ = {
-			isa = PBXGroup;
-			children = (
-				60553F452D3B528A00BAAD7F /* SearchOnlineViewController.swift */,
-				60553F462D3B528A00BAAD7F /* LocalSearchViewController.swift */,
-			);
-			path = Controller;
-			sourceTree = "<group>";
-		};
-		60553F482D3B528A00BAAD7F /* Search */ = {
-			isa = PBXGroup;
-			children = (
-				60553F3E2D3B528A00BAAD7F /* ViewModel */,
-				60553F442D3B528A00BAAD7F /* Views */,
-				60553F472D3B528A00BAAD7F /* Controller */,
-			);
-			path = Search;
-			sourceTree = "<group>";
-		};
-		60553F4D2D3B528A00BAAD7F /* View */ = {
-			isa = PBXGroup;
-			children = (
-				60553F492D3B528A00BAAD7F /* PlayButtonView.swift */,
-				60553F4A2D3B528A00BAAD7F /* PlayDetailTopView.swift */,
-				60553F4B2D3B528A00BAAD7F /* PlayDetailControlView.swift */,
-				60553F4C2D3B528A00BAAD7F /* PlayDetailPlaceHolderView.swift */,
-			);
-			path = View;
-			sourceTree = "<group>";
-		};
-		60553F512D3B528A00BAAD7F /* Controller */ = {
-			isa = PBXGroup;
-			children = (
-				60553F4E2D3B528A00BAAD7F /* SleepTimeViewController.swift */,
-				60553F4F2D3B528A00BAAD7F /* PlayDetailViewController.swift */,
-				60553F502D3B528A00BAAD7F /* PlayDetailViewController+Ext.swift */,
-			);
-			path = Controller;
-			sourceTree = "<group>";
-		};
-		60553F532D3B528A00BAAD7F /* Detail */ = {
-			isa = PBXGroup;
-			children = (
-				60553F4D2D3B528A00BAAD7F /* View */,
-				60553F512D3B528A00BAAD7F /* Controller */,
-				60553F522D3B528A00BAAD7F /* PlayerManager.swift */,
-			);
-			path = Detail;
-			sourceTree = "<group>";
-		};
-		60553F5A2D3B528A00BAAD7F /* View */ = {
-			isa = PBXGroup;
-			children = (
-				60553F542D3B528A00BAAD7F /* SongListCell.swift */,
-				60553F552D3B528A00BAAD7F /* SongDownloadCell.swift */,
-				60553F562D3B528A00BAAD7F /* CWTopCustomButton.swift */,
-				60553F572D3B528A00BAAD7F /* CDView.swift */,
-				60553F582D3B528A00BAAD7F /* PlaylistTopView.swift */,
-				60553F592D3B528A00BAAD7F /* SongListTopView.swift */,
-			);
-			path = View;
-			sourceTree = "<group>";
-		};
-		60553F5D2D3B528A00BAAD7F /* ViewModel */ = {
-			isa = PBXGroup;
-			children = (
-				60553F5B2D3B528A00BAAD7F /* SongDownloadCellViewModel.swift */,
-				60553F5C2D3B528A00BAAD7F /* SongListViewModel.swift */,
-				60F82C102D43298800FFB08D /* MusicContainerViewModel.swift */,
-			);
-			path = ViewModel;
-			sourceTree = "<group>";
-		};
-		60553F602D3B528A00BAAD7F /* Controller */ = {
-			isa = PBXGroup;
-			children = (
-				60553F5E2D3B528A00BAAD7F /* SongListViewController.swift */,
-				60553FE22D3DF12200BAAD7F /* CustomSegementItem.swift */,
-				60553F5F2D3B528A00BAAD7F /* SongListViewController+Target.swift */,
-				60F82C0E2D43295100FFB08D /* MusicHomeContainerViewController.swift */,
-				606372E62D5705F4005C82CF /* MusicPlaylistContainerViewController.swift */,
-			);
-			path = Controller;
-			sourceTree = "<group>";
-		};
-		60553F612D3B528A00BAAD7F /* List */ = {
-			isa = PBXGroup;
-			children = (
-				60553F5A2D3B528A00BAAD7F /* View */,
-				60553F5D2D3B528A00BAAD7F /* ViewModel */,
-				60553F602D3B528A00BAAD7F /* Controller */,
-			);
-			path = List;
-			sourceTree = "<group>";
-		};
-		60553F702D3B528A00BAAD7F /* Custom */ = {
-			isa = PBXGroup;
-			children = (
-				60553FDA2D3B7CC600BAAD7F /* FitManager.swift */,
-				60553F622D3B528A00BAAD7F /* BasePresentViewController.swift */,
-				60553F632D3B528A00BAAD7F /* ManageMenuAlertView.swift */,
-				60553F642D3B528A00BAAD7F /* ImageTextControl.swift */,
-				60553F652D3B528A00BAAD7F /* PlayMiniBar.swift */,
-				60553F662D3B528A00BAAD7F /* NotifactionKey.swift */,
-				60553F672D3B528A00BAAD7F /* TipsView.swift */,
-				60553F682D3B528A00BAAD7F /* THUD.swift */,
-				60553F692D3B528A00BAAD7F /* THUDProtocol.swift */,
-				60553F6A2D3B528A00BAAD7F /* THUD+CW.swift */,
-				60553F6B2D3B528A00BAAD7F /* ToastView.swift */,
-				60553F6C2D3B528A00BAAD7F /* MusicSearchBar.swift */,
-				60553F6D2D3B528A00BAAD7F /* BubbleMenuView.swift */,
-				60553F6E2D3B528A00BAAD7F /* MusicEmptyView.swift */,
-				60553F6F2D3B528A00BAAD7F /* SpacedButton.swift */,
-			);
-			path = Custom;
-			sourceTree = "<group>";
-		};
-		60553FCF2D3B54A400BAAD7F /* MusicBase */ = {
-			isa = PBXGroup;
-			children = (
-				60553FC72D3B54A400BAAD7F /* LWNavigationBar.swift */,
-				60553FC82D3B54A400BAAD7F /* LWBaseViewController.swift */,
-				60553FC92D3B54A400BAAD7F /* LWBaseNavigationController.swift */,
-				60553FCA2D3B54A400BAAD7F /* GradientButton.swift */,
-				60553FCB2D3B54A400BAAD7F /* SaveSuccessTipsView.swift */,
-				60553FCD2D3B54A400BAAD7F /* GradientText.swift */,
-				60553FCE2D3B54A400BAAD7F /* GradientBackgroundModifier.swift */,
-			);
-			path = MusicBase;
-			sourceTree = "<group>";
-		};
-		606372D62D545E55005C82CF /* Example */ = {
-			isa = PBXGroup;
-			children = (
-				606372D72D545E6C005C82CF /* Example Music.mp3 */,
-				606372D92D545F0D005C82CF /* ExampleIniter.swift */,
-			);
-			path = Example;
-			sourceTree = "<group>";
-		};
-		606372DB2D549998005C82CF /* AdMob */ = {
-			isa = PBXGroup;
-			children = (
-				606372E02D54BC37005C82CF /* GoogleMobileAdsConsentManager.swift */,
-				606372DE2D54BBB5005C82CF /* AppConfig.swift */,
-				606372DC2D54999C005C82CF /* ADScene.swift */,
-				606372E22D55A995005C82CF /* ADLoadingViewController.swift */,
-			);
-			path = AdMob;
-			sourceTree = "<group>";
-		};
 		A81CA45F2D1567CD00A3AAC8 /* LaunchVC */ = {
 		A81CA45F2D1567CD00A3AAC8 /* LaunchVC */ = {
 			isa = PBXGroup;
 			isa = PBXGroup;
 			children = (
 			children = (
@@ -801,6 +289,11 @@
 		A81CA4672D156A9400A3AAC8 /* BaseClass */ = {
 		A81CA4672D156A9400A3AAC8 /* BaseClass */ = {
 			isa = PBXGroup;
 			isa = PBXGroup;
 			children = (
 			children = (
+				603901112DF92C860096551E /* SpacedButton.swift */,
+				603901092DF92BD90096551E /* LWBaseNavigationController.swift */,
+				6039010A2DF92BD90096551E /* LWBaseViewController.swift */,
+				6039010B2DF92BD90096551E /* LWNavigationBar.swift */,
+				6039010C2DF92BD90096551E /* LWSearchBar.swift */,
 				A81F5B382D19037100740085 /* TSBaseModel.swift */,
 				A81F5B382D19037100740085 /* TSBaseModel.swift */,
 				A8F778AF2D1AC16F00BF55D5 /* TSBaseView.swift */,
 				A8F778AF2D1AC16F00BF55D5 /* TSBaseView.swift */,
 				A81CA4AB2D16944B00A3AAC8 /* TSBaseTabViewCell.swift */,
 				A81CA4AB2D16944B00A3AAC8 /* TSBaseTabViewCell.swift */,
@@ -894,8 +387,6 @@
 		A81CA48C2D15855300A3AAC8 /* Business */ = {
 		A81CA48C2D15855300A3AAC8 /* Business */ = {
 			isa = PBXGroup;
 			isa = PBXGroup;
 			children = (
 			children = (
-				606372DB2D549998005C82CF /* AdMob */,
-				60553F022D3B4DF800BAAD7F /* TSMusic */,
 				A8F76C3A2D35022300AA6E93 /* TSPurchaseMembershipVC */,
 				A8F76C3A2D35022300AA6E93 /* TSPurchaseMembershipVC */,
 				A8477C952D2272FB00DF0B93 /* TSBusinessWebVC */,
 				A8477C952D2272FB00DF0B93 /* TSBusinessWebVC */,
 				A81CA4932D16527E00A3AAC8 /* TSEditLiveVC */,
 				A81CA4932D16527E00A3AAC8 /* TSEditLiveVC */,
@@ -969,7 +460,7 @@
 		A81CA4B12D1695F300A3AAC8 /* Resource */ = {
 		A81CA4B12D1695F300A3AAC8 /* Resource */ = {
 			isa = PBXGroup;
 			isa = PBXGroup;
 			children = (
 			children = (
-				606372D62D545E55005C82CF /* Example */,
+				603901162DF9367B0096551E /* Flash-old-Tim.png */,
 				A81F5B502D19684D00740085 /* Json */,
 				A81F5B502D19684D00740085 /* Json */,
 				A81CA4B22D1695F800A3AAC8 /* Font */,
 				A81CA4B22D1695F800A3AAC8 /* Font */,
 			);
 			);
@@ -1247,7 +738,6 @@
 				A8E56BD12D1520DD003C54AF /* Frameworks */,
 				A8E56BD12D1520DD003C54AF /* Frameworks */,
 				A8E56BD22D1520DD003C54AF /* Resources */,
 				A8E56BD22D1520DD003C54AF /* Resources */,
 				CD3560202ECC0B9D97903E2D /* [CP] Embed Pods Frameworks */,
 				CD3560202ECC0B9D97903E2D /* [CP] Embed Pods Frameworks */,
-				B40DAD76327452C48197C98B /* [CP] Copy Pods Resources */,
 			);
 			);
 			buildRules = (
 			buildRules = (
 			);
 			);
@@ -1288,8 +778,6 @@
 			);
 			);
 			mainGroup = A8E56BCB2D1520DD003C54AF;
 			mainGroup = A8E56BCB2D1520DD003C54AF;
 			minimizedProjectReferenceProxies = 1;
 			minimizedProjectReferenceProxies = 1;
-			packageReferences = (
-			);
 			productRefGroup = A8E56BD52D1520DD003C54AF /* Products */;
 			productRefGroup = A8E56BD52D1520DD003C54AF /* Products */;
 			projectDirPath = "";
 			projectDirPath = "";
 			projectRoot = "";
 			projectRoot = "";
@@ -1304,10 +792,9 @@
 			isa = PBXResourcesBuildPhase;
 			isa = PBXResourcesBuildPhase;
 			buildActionMask = 2147483647;
 			buildActionMask = 2147483647;
 			files = (
 			files = (
-				606372D82D545E6C005C82CF /* Example Music.mp3 in Resources */,
 				A8C4C0A42D24218A003C46FC /* metadata.mov in Resources */,
 				A8C4C0A42D24218A003C46FC /* metadata.mov in Resources */,
-				60553FC42D3B528A00BAAD7F /* IJKPlayer.md in Resources */,
 				609B6EA52D6F1221007942D4 /* Localizable.strings in Resources */,
 				609B6EA52D6F1221007942D4 /* Localizable.strings in Resources */,
+				6039011A2DF9367B0096551E /* Flash-old-Tim.png in Resources */,
 				A8E56BF92D1520EC003C54AF /* Assets.xcassets in Resources */,
 				A8E56BF92D1520EC003C54AF /* Assets.xcassets in Resources */,
 				A81F5B522D19685900740085 /* response.json in Resources */,
 				A81F5B522D19685900740085 /* response.json in Resources */,
 				A8E56BFB2D1520EC003C54AF /* LaunchScreen.storyboard in Resources */,
 				A8E56BFB2D1520EC003C54AF /* LaunchScreen.storyboard in Resources */,
@@ -1339,23 +826,6 @@
 			shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n    # print error to STDERR\n    echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n    exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
 			shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n    # print error to STDERR\n    echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n    exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
 			showEnvVarsInLog = 0;
 			showEnvVarsInLog = 0;
 		};
 		};
-		B40DAD76327452C48197C98B /* [CP] Copy Pods Resources */ = {
-			isa = PBXShellScriptBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-			);
-			inputFileListPaths = (
-				"${PODS_ROOT}/Target Support Files/Pods-TSLiveWallpaper/Pods-TSLiveWallpaper-resources-${CONFIGURATION}-input-files.xcfilelist",
-			);
-			name = "[CP] Copy Pods Resources";
-			outputFileListPaths = (
-				"${PODS_ROOT}/Target Support Files/Pods-TSLiveWallpaper/Pods-TSLiveWallpaper-resources-${CONFIGURATION}-output-files.xcfilelist",
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-			shellPath = /bin/sh;
-			shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-TSLiveWallpaper/Pods-TSLiveWallpaper-resources.sh\"\n";
-			showEnvVarsInLog = 0;
-		};
 		CD3560202ECC0B9D97903E2D /* [CP] Embed Pods Frameworks */ = {
 		CD3560202ECC0B9D97903E2D /* [CP] Embed Pods Frameworks */ = {
 			isa = PBXShellScriptBuildPhase;
 			isa = PBXShellScriptBuildPhase;
 			buildActionMask = 2147483647;
 			buildActionMask = 2147483647;
@@ -1381,7 +851,6 @@
 			buildActionMask = 2147483647;
 			buildActionMask = 2147483647;
 			files = (
 			files = (
 				A81CA49D2D1654B600A3AAC8 /* UITableView+Ex.swift in Sources */,
 				A81CA49D2D1654B600A3AAC8 /* UITableView+Ex.swift in Sources */,
-				60553FDB2D3B7CC600BAAD7F /* FitManager.swift in Sources */,
 				A81CA4692D156AB600A3AAC8 /* TSBaseVC.swift in Sources */,
 				A81CA4692D156AB600A3AAC8 /* TSBaseVC.swift in Sources */,
 				A81CA4992D1652C400A3AAC8 /* TSMineVC.swift in Sources */,
 				A81CA4992D1652C400A3AAC8 /* TSMineVC.swift in Sources */,
 				A8477C992D2291F800DF0B93 /* UserDefault+Ex.swift in Sources */,
 				A8477C992D2291F800DF0B93 /* UserDefault+Ex.swift in Sources */,
@@ -1389,11 +858,9 @@
 				A8F76C3C2D35026200AA6E93 /* TSPurchaseMembershipVC.swift in Sources */,
 				A8F76C3C2D35026200AA6E93 /* TSPurchaseMembershipVC.swift in Sources */,
 				A81CA46E2D156C7000A3AAC8 /* GlobalImports.swift in Sources */,
 				A81CA46E2D156C7000A3AAC8 /* GlobalImports.swift in Sources */,
 				A87833202D293EEC00E47F2C /* TSSimpleTableView.swift in Sources */,
 				A87833202D293EEC00E47F2C /* TSSimpleTableView.swift in Sources */,
-				606372E52D55BAB8005C82CF /* GuideBubbleView.swift in Sources */,
 				A8F774522D3757E700AA6E93 /* Color+Ex.swift in Sources */,
 				A8F774522D3757E700AA6E93 /* Color+Ex.swift in Sources */,
 				A81F5B4D2D1965F800740085 /* UIImage+Ex.swift in Sources */,
 				A81F5B4D2D1965F800740085 /* UIImage+Ex.swift in Sources */,
 				A81CA4832D157F5C00A3AAC8 /* UIImageView+Ex.swift in Sources */,
 				A81CA4832D157F5C00A3AAC8 /* UIImageView+Ex.swift in Sources */,
-				60F82C112D43298800FFB08D /* MusicContainerViewModel.swift in Sources */,
 				A81F5B322D18FA2E00740085 /* Component.swift in Sources */,
 				A81F5B322D18FA2E00740085 /* Component.swift in Sources */,
 				A81F5B332D18FA2E00740085 /* CommonSectionComponent.swift in Sources */,
 				A81F5B332D18FA2E00740085 /* CommonSectionComponent.swift in Sources */,
 				A81F5B492D1956EA00740085 /* UIScreen.swift in Sources */,
 				A81F5B492D1956EA00740085 /* UIScreen.swift in Sources */,
@@ -1404,25 +871,21 @@
 				A81CA4722D1575B900A3AAC8 /* TSBaseNavigationBarView.swift in Sources */,
 				A81CA4722D1575B900A3AAC8 /* TSBaseNavigationBarView.swift in Sources */,
 				A81F5B5B2D1A5F2300740085 /* TSHomeTopBannerCell.swift in Sources */,
 				A81F5B5B2D1A5F2300740085 /* TSHomeTopBannerCell.swift in Sources */,
 				A83946312D1D66A000ABFF0D /* TSTermsServiceVC.swift in Sources */,
 				A83946312D1D66A000ABFF0D /* TSTermsServiceVC.swift in Sources */,
+				6039010D2DF92BD90096551E /* LWBaseNavigationController.swift in Sources */,
+				6039010E2DF92BD90096551E /* LWNavigationBar.swift in Sources */,
+				6039010F2DF92BD90096551E /* LWBaseViewController.swift in Sources */,
+				603901142DF92C860096551E /* SpacedButton.swift in Sources */,
+				603901102DF92BD90096551E /* LWSearchBar.swift in Sources */,
 				A8C4C0982D242154003C46FC /* LivePhoto.swift in Sources */,
 				A8C4C0982D242154003C46FC /* LivePhoto.swift in Sources */,
 				A81F5B472D19562800740085 /* EditorVideoControlMaskView.swift in Sources */,
 				A81F5B472D19562800740085 /* EditorVideoControlMaskView.swift in Sources */,
 				A81F5B392D19037800740085 /* TSBaseModel.swift in Sources */,
 				A81F5B392D19037800740085 /* TSBaseModel.swift in Sources */,
 				A81CA4A62D16915F00A3AAC8 /* Dictionary+Ex.swift in Sources */,
 				A81CA4A62D16915F00A3AAC8 /* Dictionary+Ex.swift in Sources */,
-				606372DA2D545F0D005C82CF /* ExampleIniter.swift in Sources */,
 				A81CA4AA2D16943800A3AAC8 /* TSMineCell.swift in Sources */,
 				A81CA4AA2D16943800A3AAC8 /* TSMineCell.swift in Sources */,
 				A83946212D1D61D600ABFF0D /* TSRateUsVC.swift in Sources */,
 				A83946212D1D61D600ABFF0D /* TSRateUsVC.swift in Sources */,
 				A81F5B4F2D19674600740085 /* AVAsset+Ex.swift in Sources */,
 				A81F5B4F2D19674600740085 /* AVAsset+Ex.swift in Sources */,
 				A8E56BF62D1520EC003C54AF /* AppDelegate.swift in Sources */,
 				A8E56BF62D1520EC003C54AF /* AppDelegate.swift in Sources */,
 				A8F778B42D1BB8F600BF55D5 /* PhotoManager.swift in Sources */,
 				A8F778B42D1BB8F600BF55D5 /* PhotoManager.swift in Sources */,
 				A81CA4872D15832900A3AAC8 /* UILabel+Ex.swift in Sources */,
 				A81CA4872D15832900A3AAC8 /* UILabel+Ex.swift in Sources */,
-				60553FD02D3B54A400BAAD7F /* LWNavigationBar.swift in Sources */,
-				60553FD22D3B54A400BAAD7F /* GradientButton.swift in Sources */,
-				60553FD42D3B54A400BAAD7F /* LWBaseViewController.swift in Sources */,
-				60553FD62D3B54A400BAAD7F /* SaveSuccessTipsView.swift in Sources */,
-				60553FD72D3B54A400BAAD7F /* GradientText.swift in Sources */,
-				60553FD82D3B54A400BAAD7F /* LWBaseNavigationController.swift in Sources */,
-				60553FD92D3B54A400BAAD7F /* GradientBackgroundModifier.swift in Sources */,
-				606372DD2D54999C005C82CF /* ADScene.swift in Sources */,
 				A81F5B5D2D1A906C00740085 /* TSHomeDataModel.swift in Sources */,
 				A81F5B5D2D1A906C00740085 /* TSHomeDataModel.swift in Sources */,
 				A8F778B02D1AC17500BF55D5 /* TSBaseView.swift in Sources */,
 				A8F778B02D1AC17500BF55D5 /* TSBaseView.swift in Sources */,
 				A81CA49B2D1652CA00A3AAC8 /* TSHomeVC.swift in Sources */,
 				A81CA49B2D1652CA00A3AAC8 /* TSHomeVC.swift in Sources */,
@@ -1431,7 +894,6 @@
 				60553FDD2D3B84E700BAAD7F /* UIScrollView+Ext.swift in Sources */,
 				60553FDD2D3B84E700BAAD7F /* UIScrollView+Ext.swift in Sources */,
 				A81CA4792D1577E800A3AAC8 /* NSString+Ex.swift in Sources */,
 				A81CA4792D1577E800A3AAC8 /* NSString+Ex.swift in Sources */,
 				A81CA4852D1582A600A3AAC8 /* UIButton+Ex.swift in Sources */,
 				A81CA4852D1582A600A3AAC8 /* UIButton+Ex.swift in Sources */,
-				606372E72D5705F4005C82CF /* MusicPlaylistContainerViewController.swift in Sources */,
 				A81CA46B2D156BDC00A3AAC8 /* TSBaseNavigationC.swift in Sources */,
 				A81CA46B2D156BDC00A3AAC8 /* TSBaseNavigationC.swift in Sources */,
 				A81CA47F2D15789C00A3AAC8 /* TSConfig.swift in Sources */,
 				A81CA47F2D15789C00A3AAC8 /* TSConfig.swift in Sources */,
 				A81CA49F2D1655CE00A3AAC8 /* UICollectionView+Ex.swift in Sources */,
 				A81CA49F2D1655CE00A3AAC8 /* UICollectionView+Ex.swift in Sources */,
@@ -1449,101 +911,15 @@
 				A81CA48B2D15843700A3AAC8 /* TSCommonTool.swift in Sources */,
 				A81CA48B2D15843700A3AAC8 /* TSCommonTool.swift in Sources */,
 				A81CA4AD2D16944B00A3AAC8 /* TSBaseTabViewCell.swift in Sources */,
 				A81CA4AD2D16944B00A3AAC8 /* TSBaseTabViewCell.swift in Sources */,
 				A84C239A2D1E3A4300B61B55 /* GPVideoPlayerView.swift in Sources */,
 				A84C239A2D1E3A4300B61B55 /* GPVideoPlayerView.swift in Sources */,
-				60553F722D3B528A00BAAD7F /* PlayDetailListViewContoller.swift in Sources */,
-				60553F732D3B528A00BAAD7F /* SearchResultViewModel.swift in Sources */,
-				60553F742D3B528A00BAAD7F /* Consts.swift in Sources */,
-				60553F752D3B528A00BAAD7F /* MusicEmptyView.swift in Sources */,
-				60553F762D3B528A00BAAD7F /* CWMutiSelectOpeateView.swift in Sources */,
-				60553F772D3B528A00BAAD7F /* DownloadButton.swift in Sources */,
-				60553F782D3B528A00BAAD7F /* ManageMenuAlertView.swift in Sources */,
-				60553F792D3B528A00BAAD7F /* SongListBottomView.swift in Sources */,
-				60553F7A2D3B528A00BAAD7F /* PlaylistViewController.swift in Sources */,
-				60553F7B2D3B528A00BAAD7F /* PlaylistTopView.swift in Sources */,
-				60553F7C2D3B528A00BAAD7F /* AddPlayListViewController.swift in Sources */,
-				60553F7D2D3B528A00BAAD7F /* PlayDetailTopView.swift in Sources */,
-				60553F7E2D3B528A00BAAD7F /* CWOperateViewController+Ext.swift in Sources */,
-				60553F7F2D3B528A00BAAD7F /* OperateTopView.swift in Sources */,
-				60553F802D3B528A00BAAD7F /* PlayDetailViewController+Ext.swift in Sources */,
-				60553F812D3B528A00BAAD7F /* SJIJKMediaPlayer.m in Sources */,
-				60553F822D3B528A00BAAD7F /* SearchResultViewController.swift in Sources */,
-				60553F832D3B528A00BAAD7F /* THUD+CW.swift in Sources */,
-				60553F842D3B528A00BAAD7F /* SongListManageViewModel.swift in Sources */,
-				60553F852D3B528A00BAAD7F /* SongDownloadCellViewModel.swift in Sources */,
-				60553F862D3B528A00BAAD7F /* PlayDetailControlView.swift in Sources */,
-				60553F872D3B528A00BAAD7F /* PlayDetailListViewModel.swift in Sources */,
-				606372E32D55A995005C82CF /* ADLoadingViewController.swift in Sources */,
-				60553F882D3B528A00BAAD7F /* SearchViewModel.swift in Sources */,
-				60553F892D3B528A00BAAD7F /* CWOperateViewController.swift in Sources */,
-				60553F8A2D3B528A00BAAD7F /* THUDProtocol.swift in Sources */,
-				60553F8B2D3B528A00BAAD7F /* THUD.swift in Sources */,
-				60553F8C2D3B528A00BAAD7F /* PlayDetailViewController.swift in Sources */,
-				60553F8D2D3B528A00BAAD7F /* CWCustomProgressView.swift in Sources */,
-				60553F8E2D3B528A00BAAD7F /* PlaylistDetailViewController.swift in Sources */,
-				60553F8F2D3B528A00BAAD7F /* SleepTimeViewController.swift in Sources */,
-				60553F902D3B528A00BAAD7F /* CWLoadingView.swift in Sources */,
-				60553F912D3B528A00BAAD7F /* PlayListDetaiViewModel.swift in Sources */,
-				60553F922D3B528A00BAAD7F /* SJIJKMediaPlayerLayerView.m in Sources */,
-				60553F932D3B528A00BAAD7F /* CWSearchTextBar.swift in Sources */,
-				60553F942D3B528A00BAAD7F /* SongListCell.swift in Sources */,
-				60553F952D3B528A00BAAD7F /* AddPlayListViewModel.swift in Sources */,
-				60553F962D3B528A00BAAD7F /* BaseDataModel.swift in Sources */,
-				60553F972D3B528A00BAAD7F /* PlayDetailPlaceHolderView.swift in Sources */,
-				60553F982D3B528A00BAAD7F /* SJIJKMediaPlaybackController.m in Sources */,
-				60553F992D3B528A00BAAD7F /* FilterBarViewModel.swift in Sources */,
-				60F82C0F2D43295100FFB08D /* MusicHomeContainerViewController.swift in Sources */,
-				60553F9A2D3B528A00BAAD7F /* PlayListManageView.swift in Sources */,
-				606372DF2D54BBB5005C82CF /* AppConfig.swift in Sources */,
-				60553F9B2D3B528A00BAAD7F /* LWSearchBar.swift in Sources */,
-				60553F9C2D3B528A00BAAD7F /* BubbleMenuView.swift in Sources */,
-				60553F9D2D3B528A00BAAD7F /* SongListViewModel.swift in Sources */,
-				60553F9E2D3B528A00BAAD7F /* SearchResultStateView.swift in Sources */,
-				60553F9F2D3B528A00BAAD7F /* FilterBarView.swift in Sources */,
-				60553FA02D3B528A00BAAD7F /* SongListViewController+Target.swift in Sources */,
-				60553FA12D3B528A00BAAD7F /* ToastView.swift in Sources */,
-				60553FA22D3B528A00BAAD7F /* SongListViewController.swift in Sources */,
-				60553FA32D3B528A00BAAD7F /* PlayListTopItemView.swift in Sources */,
-				60553FA42D3B528A00BAAD7F /* VipTagView.swift in Sources */,
-				60553FA52D3B528A00BAAD7F /* CWTopCustomButton.swift in Sources */,
-				60553FA62D3B528A00BAAD7F /* RelateSeachCell.swift in Sources */,
-				60553FA72D3B528A00BAAD7F /* PlaylistViewController+Ext.swift in Sources */,
-				60553FA82D3B528A00BAAD7F /* CWOperateItemView.swift in Sources */,
-				60553FA92D3B528A00BAAD7F /* CustomTextField.swift in Sources */,
-				60553FAA2D3B528A00BAAD7F /* CWOperateButton.swift in Sources */,
-				60553FAB2D3B528A00BAAD7F /* PlayListViewModel.swift in Sources */,
-				60553FAC2D3B528A00BAAD7F /* TagListView.swift in Sources */,
-				60553FAD2D3B528A00BAAD7F /* ImageTextControl.swift in Sources */,
-				60553FAE2D3B528A00BAAD7F /* CWProgressView.swift in Sources */,
-				60553FAF2D3B528A00BAAD7F /* TipsView.swift in Sources */,
-				60553FB02D3B528A00BAAD7F /* PlayMiniBar.swift in Sources */,
-				60553FB12D3B528A00BAAD7F /* SongDownloadCell.swift in Sources */,
-				60553FB22D3B528A00BAAD7F /* LocalSearchViewModel.swift in Sources */,
-				60553FB32D3B528A00BAAD7F /* SortMenuViewController.swift in Sources */,
-				60553FB42D3B528A00BAAD7F /* ImportFilesManager.swift in Sources */,
-				60553FB52D3B528A00BAAD7F /* PlayButtonView.swift in Sources */,
-				60553FB62D3B528A00BAAD7F /* PlayDetailListViewCell.swift in Sources */,
-				60553FB72D3B528A00BAAD7F /* FilterBarViewController.swift in Sources */,
-				60553FB82D3B528A00BAAD7F /* SongListTopView.swift in Sources */,
-				60553FB92D3B528A00BAAD7F /* CDView.swift in Sources */,
-				60553FBA2D3B528A00BAAD7F /* NotifactionKey.swift in Sources */,
-				60553FBB2D3B528A00BAAD7F /* PlayListAddCell.swift in Sources */,
-				60553FBC2D3B528A00BAAD7F /* SearchOnlineViewController.swift in Sources */,
-				60553FBD2D3B528A00BAAD7F /* SpacedButton.swift in Sources */,
-				60553FBE2D3B528A00BAAD7F /* BasePresentViewController.swift in Sources */,
 				60553FDF2D3B850C00BAAD7F /* TimeInterval+Ext.swift in Sources */,
 				60553FDF2D3B850C00BAAD7F /* TimeInterval+Ext.swift in Sources */,
-				60553FBF2D3B528A00BAAD7F /* PlayListCell.swift in Sources */,
-				60553FC12D3B528A00BAAD7F /* MusicSearchBar.swift in Sources */,
-				60553FC22D3B528A00BAAD7F /* PlayerManager.swift in Sources */,
-				60553FC32D3B528A00BAAD7F /* LocalSearchViewController.swift in Sources */,
 				A8F76C472D3510FE00AA6E93 /* TSNetworkManager.swift in Sources */,
 				A8F76C472D3510FE00AA6E93 /* TSNetworkManager.swift in Sources */,
 				A84C239B2D1E3A4300B61B55 /* GPVideoClipperController.swift in Sources */,
 				A84C239B2D1E3A4300B61B55 /* GPVideoClipperController.swift in Sources */,
-				60553FE32D3DF12200BAAD7F /* CustomSegementItem.swift in Sources */,
 				A84C239C2D1E3A4300B61B55 /* GPVideoClipperView.swift in Sources */,
 				A84C239C2D1E3A4300B61B55 /* GPVideoClipperView.swift in Sources */,
 				A84C239D2D1E3A4300B61B55 /* GPVideoConfigMaker.swift in Sources */,
 				A84C239D2D1E3A4300B61B55 /* GPVideoConfigMaker.swift in Sources */,
 				A839463C2D1D6E3600ABFF0D /* TSRandomWallpaperCopyrightVC.swift in Sources */,
 				A839463C2D1D6E3600ABFF0D /* TSRandomWallpaperCopyrightVC.swift in Sources */,
 				A81CA4AE2D16944B00A3AAC8 /* TSBaseCollectionCell.swift in Sources */,
 				A81CA4AE2D16944B00A3AAC8 /* TSBaseCollectionCell.swift in Sources */,
 				A81CA4772D15779E00A3AAC8 /* UIColor+Ex.swift in Sources */,
 				A81CA4772D15779E00A3AAC8 /* UIColor+Ex.swift in Sources */,
 				A81CA4952D1652B500A3AAC8 /* TSEditLiveVC.swift in Sources */,
 				A81CA4952D1652B500A3AAC8 /* TSEditLiveVC.swift in Sources */,
-				606372E12D54BC37005C82CF /* GoogleMobileAdsConsentManager.swift in Sources */,
 				A83946332D1D66A900ABFF0D /* TSPrivacyPolicyVC.swift in Sources */,
 				A83946332D1D66A900ABFF0D /* TSPrivacyPolicyVC.swift in Sources */,
 				A81CA47B2D15784800A3AAC8 /* Int+Ex.swift in Sources */,
 				A81CA47B2D15784800A3AAC8 /* Int+Ex.swift in Sources */,
 				A839463A2D1D6E3000ABFF0D /* TSRandomWallpaperTutorialsVC.swift in Sources */,
 				A839463A2D1D6E3000ABFF0D /* TSRandomWallpaperTutorialsVC.swift in Sources */,
@@ -1616,13 +992,13 @@
 				ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
 				ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
 				CODE_SIGN_IDENTITY = "Apple Development";
 				CODE_SIGN_IDENTITY = "Apple Development";
 				CODE_SIGN_STYLE = Automatic;
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 2;
+				CURRENT_PROJECT_VERSION = 1;
 				DEVELOPMENT_TEAM = 65UD255J84;
 				DEVELOPMENT_TEAM = 65UD255J84;
 				ENABLE_APP_SANDBOX = NO;
 				ENABLE_APP_SANDBOX = NO;
 				ENABLE_USER_SCRIPT_SANDBOXING = NO;
 				ENABLE_USER_SCRIPT_SANDBOXING = NO;
 				GENERATE_INFOPLIST_FILE = YES;
 				GENERATE_INFOPLIST_FILE = YES;
 				INFOPLIST_FILE = TSLiveWallpaper/Info.plist;
 				INFOPLIST_FILE = TSLiveWallpaper/Info.plist;
-				INFOPLIST_KEY_CFBundleDisplayName = "Cloud Music";
+				INFOPLIST_KEY_CFBundleDisplayName = "Old-Time\n";
 				INFOPLIST_KEY_NSLocationWhenInUseUsageDescription = "This app needs to access your location information while you're using it to provide relevant location services and features. We promise to only obtain your location information when you're using the app and to use it solely for providing services and features.";
 				INFOPLIST_KEY_NSLocationWhenInUseUsageDescription = "This app needs to access your location information while you're using it to provide relevant location services and features. We promise to only obtain your location information when you're using the app and to use it solely for providing services and features.";
 				INFOPLIST_KEY_NSPhotoLibraryUsageDescription = "Allow us to access Photos in order to save wallpapers to your device.";
 				INFOPLIST_KEY_NSPhotoLibraryUsageDescription = "Allow us to access Photos in order to save wallpapers to your device.";
 				INFOPLIST_KEY_NSUserTrackingUsageDescription = "It will only be used to measure advertising efficiency without leaking any of your personal information.";
 				INFOPLIST_KEY_NSUserTrackingUsageDescription = "It will only be used to measure advertising efficiency without leaking any of your personal information.";
@@ -1634,7 +1010,7 @@
 					"$(inherited)",
 					"$(inherited)",
 					"@executable_path/Frameworks",
 					"@executable_path/Frameworks",
 				);
 				);
-				MARKETING_VERSION = 3.2;
+				MARKETING_VERSION = 3.3;
 				PRODUCT_BUNDLE_IDENTIFIER = musicplayer.offline.com;
 				PRODUCT_BUNDLE_IDENTIFIER = musicplayer.offline.com;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				PROVISIONING_PROFILE_SPECIFIER = "";
 				PROVISIONING_PROFILE_SPECIFIER = "";
@@ -1657,13 +1033,13 @@
 				ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
 				ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
 				CODE_SIGN_IDENTITY = "Apple Development";
 				CODE_SIGN_IDENTITY = "Apple Development";
 				CODE_SIGN_STYLE = Automatic;
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 2;
+				CURRENT_PROJECT_VERSION = 1;
 				DEVELOPMENT_TEAM = 65UD255J84;
 				DEVELOPMENT_TEAM = 65UD255J84;
 				ENABLE_APP_SANDBOX = NO;
 				ENABLE_APP_SANDBOX = NO;
 				ENABLE_USER_SCRIPT_SANDBOXING = NO;
 				ENABLE_USER_SCRIPT_SANDBOXING = NO;
 				GENERATE_INFOPLIST_FILE = YES;
 				GENERATE_INFOPLIST_FILE = YES;
 				INFOPLIST_FILE = TSLiveWallpaper/Info.plist;
 				INFOPLIST_FILE = TSLiveWallpaper/Info.plist;
-				INFOPLIST_KEY_CFBundleDisplayName = "Cloud Music";
+				INFOPLIST_KEY_CFBundleDisplayName = "Old-Time\n";
 				INFOPLIST_KEY_NSLocationWhenInUseUsageDescription = "This app needs to access your location information while you're using it to provide relevant location services and features. We promise to only obtain your location information when you're using the app and to use it solely for providing services and features.";
 				INFOPLIST_KEY_NSLocationWhenInUseUsageDescription = "This app needs to access your location information while you're using it to provide relevant location services and features. We promise to only obtain your location information when you're using the app and to use it solely for providing services and features.";
 				INFOPLIST_KEY_NSPhotoLibraryUsageDescription = "Allow us to access Photos in order to save wallpapers to your device.";
 				INFOPLIST_KEY_NSPhotoLibraryUsageDescription = "Allow us to access Photos in order to save wallpapers to your device.";
 				INFOPLIST_KEY_NSUserTrackingUsageDescription = "It will only be used to measure advertising efficiency without leaking any of your personal information.";
 				INFOPLIST_KEY_NSUserTrackingUsageDescription = "It will only be used to measure advertising efficiency without leaking any of your personal information.";
@@ -1675,7 +1051,7 @@
 					"$(inherited)",
 					"$(inherited)",
 					"@executable_path/Frameworks",
 					"@executable_path/Frameworks",
 				);
 				);
-				MARKETING_VERSION = 3.2;
+				MARKETING_VERSION = 3.3;
 				PRODUCT_BUNDLE_IDENTIFIER = musicplayer.offline.com;
 				PRODUCT_BUNDLE_IDENTIFIER = musicplayer.offline.com;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				PROVISIONING_PROFILE_SPECIFIER = "";
 				PROVISIONING_PROFILE_SPECIFIER = "";

BIN
TSLiveWallpaper/.DS_Store


+ 0 - 51
TSLiveWallpaper/AppDelegate.swift

@@ -5,11 +5,8 @@
 //  Created by 100Years on 2024/12/19.i
 //  Created by 100Years on 2024/12/19.i
 //
 //
 
 
-import ADManager
 import AppTrackingTransparency
 import AppTrackingTransparency
-import GoogleMobileAds
 import StoreKit
 import StoreKit
-import TSVideoKit
 import UIKit
 import UIKit
 
 
 @main
 @main
@@ -21,8 +18,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
         window?.backgroundColor = UIColor.white
         window?.backgroundColor = UIColor.white
         window?.makeKeyAndVisible()
         window?.makeKeyAndVisible()
         goToLoadVC()
         goToLoadVC()
-        initBaseDatas()
-        downloadNotifaction()
         return true
         return true
     }
     }
 
 
@@ -36,36 +31,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
         
         
     }
     }
 
 
-    func initBaseDatas() {
-        var config = TSConfiguration.default
-        config.configurePath = "http://p.100yearslater.com/live/config"
-        TSVideoOperator.shared.loadWithConfiguration(config: config, needJs: true)
-
-        if let videoId = UserDefaults.standard.string(forKey: "lastedVideoId"),
-           !videoId.isEmpty,
-           let lastVideo = TSVideoOperator.shared.dataManager.fetchVideo(videoId: videoId) {
-            TSVideoOperator.shared.playerViewModel.currentVideo = lastVideo
-            TSVideoOperator.shared.playerViewModel.currentVideos = TSVideoOperator.shared.dataManager.fetchCachedVideos()
-            PlayerManager.shared.miniBar.updateVideoInfo(video: lastVideo, state: .pause)
-        }
-
-        if let loopMode = UserDefaults.standard.string(forKey: "lastedPlayMode") {
-            let mMode = LoopMode(rawValue: loopMode) ?? .cyclic
-            TSVideoOperator.shared.playerViewModel.loopMode = mMode
-        }
-    }
-
-    @objc func recordData() {
-        if UserDefaults.standard.value(forKey: "CachedTag") == nil {
-            UserDefaults.standard.setValue("1", forKey: "CachedTag")
-            SKStoreReviewController.requestReview()
-        }
-    }
-
-    func downloadNotifaction() {
-        NotificationCenter.default.addObserver(self, selector: #selector(recordData), name: kGroupDownloadFinishNotifactionName, object: nil)
-    }
-
     static func requestAdTrack() {
     static func requestAdTrack() {
         DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
         DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
             ATTrackingManager.requestTrackingAuthorization(completionHandler: { status in
             ATTrackingManager.requestTrackingAuthorization(completionHandler: { status in
@@ -90,22 +55,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
         AppDelegate.requestAdTrack()
         AppDelegate.requestAdTrack()
     }
     }
 
 
-    func applicationWillTerminate(_ application: UIApplication) {
-        UserDefaults.standard.setValue(PlayerManager.shared.currentVideo?.videoId ?? "", forKey: "lastedVideoId")
-        UserDefaults.standard.setValue(PlayerManager.shared.currentLoopMode.rawValue, forKey: "lastedPlayMode")
-    }
-
-    func applicationWillEnterForeground(_ application: UIApplication) {
-        // 热启动显示开屏广告
-        if let topVC = UIApplication.defaultViewController?.topVc {
-            if PurchaseManager.default.isVip {
-                return
-            }
-            DispatchQueue.main.asyncAfter(deadline: .now() + 0.4) {
-                ADManager.shared.showLaunchAdWhenActive(scene: ADScene.launch, from: topVC)
-            }
-        }
-    }
 }
 }
 
 
 extension AppDelegate {
 extension AppDelegate {

+ 23 - 0
TSLiveWallpaper/Assets.xcassets/Vip/Old-Tim.imageset/Contents.json

@@ -0,0 +1,23 @@
+{
+  "images" : [
+    {
+      "filename" : "Old-Tim@1x.png",
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "Old-Tim@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "filename" : "Old-Tim@3x.png",
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

BIN
TSLiveWallpaper/Assets.xcassets/Vip/Old-Tim.imageset/Old-Tim@1x.png


BIN
TSLiveWallpaper/Assets.xcassets/Vip/Old-Tim.imageset/Old-Tim@2x.png


BIN
TSLiveWallpaper/Assets.xcassets/Vip/Old-Tim.imageset/Old-Tim@3x.png


+ 23 - 0
TSLiveWallpaper/Assets.xcassets/Vip/Old-Tim_pro.imageset/Contents.json

@@ -0,0 +1,23 @@
+{
+  "images" : [
+    {
+      "filename" : "Old-Tim_pro@1x.png",
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "Old-Tim_pro@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "filename" : "Old-Tim_pro@3x.png",
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

BIN
TSLiveWallpaper/Assets.xcassets/Vip/Old-Tim_pro.imageset/Old-Tim_pro@1x.png


BIN
TSLiveWallpaper/Assets.xcassets/Vip/Old-Tim_pro.imageset/Old-Tim_pro@2x.png


BIN
TSLiveWallpaper/Assets.xcassets/Vip/Old-Tim_pro.imageset/Old-Tim_pro@3x.png


+ 3 - 3
TSLiveWallpaper/Base.lproj/LaunchScreen.storyboard

@@ -20,8 +20,8 @@
                             <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="view_main_bg" translatesAutoresizingMaskIntoConstraints="NO" id="k6m-Z3-ud5">
                             <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="view_main_bg" translatesAutoresizingMaskIntoConstraints="NO" id="k6m-Z3-ud5">
                                 <rect key="frame" x="-10" y="-10" width="413" height="872"/>
                                 <rect key="frame" x="-10" y="-10" width="413" height="872"/>
                             </imageView>
                             </imageView>
-                            <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="Cloud_Music" translatesAutoresizingMaskIntoConstraints="NO" id="hat-TL-4Cc">
-                                <rect key="frame" x="77.666666666666686" y="410" width="238" height="32"/>
+                            <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="Flash-old-Tim.png" translatesAutoresizingMaskIntoConstraints="NO" id="hat-TL-4Cc">
+                                <rect key="frame" x="85.666666666666686" y="405" width="222" height="42"/>
                             </imageView>
                             </imageView>
                         </subviews>
                         </subviews>
                         <viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
                         <viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
@@ -42,7 +42,7 @@
         </scene>
         </scene>
     </scenes>
     </scenes>
     <resources>
     <resources>
-        <image name="Cloud_Music" width="238" height="32"/>
+        <image name="Flash-old-Tim.png" width="222" height="42"/>
         <image name="view_main_bg" width="375" height="812"/>
         <image name="view_main_bg" width="375" height="812"/>
         <systemColor name="systemBackgroundColor">
         <systemColor name="systemBackgroundColor">
             <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
             <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>

+ 0 - 138
TSLiveWallpaper/Business/AdMob/ADLoadingViewController.swift

@@ -1,138 +0,0 @@
-//
-//  ADLoadingViewController.swift
-//  ColorfulWallpaper
-//
-//  Created by nkl on 2024/9/25.
-//
-
-import UIKit
-import ADManager
-
-class ADLoadingViewController: BasePresentViewController {
-    var adScene: ADScene = .unknow
-    var finishedHandler: ((Bool) -> Void)?
-
-    private let totalDuration: TimeInterval = 10
-    private var remindTimeInterval: TimeInterval = 0
-    private var loadCompletionHandler: ADCompletionHandler?
-
-    // 定时器
-    private var timer: DispatchSourceTimer?
-    override func viewDidLoad() {
-        super.viewDidLoad()
-
-        loadCompletionHandler = { [weak self] state in
-            guard let self = self else { return }
-
-            switch state {
-            case .willPresent:
-                THUD.hide()
-            case .finished:
-                let finishedHandler = self.finishedHandler
-                finishedHandler?(true)
-            case .fail:
-                self.stopTimer()
-                self.updateLoadingState(.failure)
-            case .loadSuccess:
-                self.stopTimer()
-                // 加载成功,且未超过计时,显示,超时则本次不展示
-                if remindTimeInterval > 0 {
-                    self.view.backgroundColor = .clear
-                    self.dismiss(animated: false) {
-                        if let vc = PlayerManager.shared.rootVc {
-                            vc.presentingViewController?.dismiss(animated: false)
-                            DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) {
-                                ADManager.shared.showAd(scene: self.adScene, from: vc) { state in
-                                    switch state {
-                                    case .willPresent:
-                                        THUD.hide()
-                                    case .finished:
-                                        let finishedHandler = self.finishedHandler
-                                        finishedHandler?(true)
-                                    case .fail:
-                                        self.stopTimer()
-                                        self.updateLoadingState(.failure)
-                                    case .loadSuccess:
-                                        self.stopTimer()
-                                    }
-                                }
-                            }
-                        }
-                    }
-                }
-            }
-        }
-
-        DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
-            self.startLoadAD()
-        }
-    }
-
-    override var shouldDismissWhenTapBackground: Bool {
-        return false
-    }
-
-    override var alertBackgroundColor: UIColor {
-        return .clear
-    }
-
-    func startLoadAD() {
-        updateLoadingState(.loading)
-        startTimer()
-
-        ADManager.shared.requestAd(for: adScene, completionHandler: loadCompletionHandler)
-    }
-
-    private func startTimer() {
-        remindTimeInterval = totalDuration
-        if timer == nil {
-            print("===剩余:\(remindTimeInterval)")
-            timer = DispatchSource.makeTimerSource(queue: DispatchQueue.global())
-            timer?.schedule(deadline: .now(), repeating: .milliseconds(200))
-            timer?.setEventHandler { [weak self] in
-                guard let self = self else { return }
-                self.remindTimeInterval -= 0.2
-                print("===剩余:\(self.remindTimeInterval)")
-                if self.remindTimeInterval <= 0 {
-                    self.stopTimer()
-                    DispatchQueue.main.async {
-                        self.updateLoadingState(.failure)
-                    }
-                }
-            }
-            timer?.resume()
-        }
-    }
-
-    func stopTimer() {
-        timer?.cancel()
-        timer = nil
-    }
-
-    enum State {
-        case loading
-        case failure
-    }
-
-    func updateLoadingState(_ state: State) {
-        switch state {
-        case .loading:
-            THUD.showLoading("Unlocking...".localized(), message: "It will be unlocked after an ad.".localized())
-        case .failure:
-            THUD.showLoading(UIImage(named: "img-pre-ad-emo-error"), message: "Loading Failed".localized()) { [weak self] isClose in
-                THUD.hide()
-                if isClose {
-                    self?.dismiss(animated: false) {
-                        self?.finishedHandler?(false)
-                    }
-                } else {
-                    self?.startLoadAD()
-                }
-            }
-        }
-    }
-
-    deinit {
-        print("===deinit: \(Self.description())")
-    }
-}

+ 0 - 88
TSLiveWallpaper/Business/AdMob/ADScene.swift

@@ -1,88 +0,0 @@
-//
-//  ADScene.swift
-//
-
-/**
- 随机壁纸的广告;
- ca-app-pub-4941656534177879/9888331446  下载的激励广告
- ca-app-pub-4941656534177879/5488145330 开屏广告
- ca-app-pub-4941656534177879/2201413111 播放的插屏广告(冷启动后,每个播放列表只展示一次,就是比如第一次点击没出,继续拉取,第二次点击出,第二次没出,第三次出)
- ca-app-pub-4941656534177879/9397376852 搜索广告(每次第一次点击搜索框出广告)
- */
-
-import ADManager
-import Foundation
-
-// TODO: !!!
-
-// #if DEBUG
-// private let GAD_ID_Launch                   = "ca-app-pub-3940256099942544/5575463023"
-// private let GAD_ID_Search_Insert            = "ca-app-pub-3940256099942544/4411468910"
-// private let GAD_ID_Play_Insert              = "ca-app-pub-3940256099942544/4411468910"
-// private let GAD_ID_Download_Reward          = "ca-app-pub-3940256099942544/1712485313"
-// private let GAD_ID_Playlist                 = "ca-app-pub-3940256099942544/4411468910"
-// private let GAD_ID_Pause                    = "ca-app-pub-3940256099942544/4411468910"
-
-// #else
-
-// 开屏广告
-private let GAD_ID_Launch = "ca-app-pub-4941656534177879/5488145330"
-// 点击搜索时弹出的插屏广告
-private let GAD_ID_Search_Insert = "ca-app-pub-4941656534177879/9397376852"
-// 播放视频时弹出的插屏广告
-private let GAD_ID_Play_Insert = "ca-app-pub-4941656534177879/2201413111"
-// 下载视频弹出的激励广告
-private let GAD_ID_Download_Reward = "ca-app-pub-4941656534177879/9888331446"
-// 歌单
-private let GAD_ID_Playlist = "ca-app-pub-4941656534177879/3683573641"
-// 暂停
-private let GAD_ID_Pause = "ca-app-pub-4941656534177879/7350252261"
-
-// #endif
-
-enum ADScene: CaseIterable, ADSceneProtocol {
-    case unknow
-    case launch // 开屏
-
-    case searchInsert // 进入搜索,插屏广告
-    case playInsert // 第一次进入视频播放,插屏广告
-    case downloadReward // 下载视频,激励广告
-    case playlist
-    case pause
-
-    static var prepareScenes: [ADScene] {
-        return [.searchInsert, .playInsert, .downloadReward, .playlist, .pause]
-    }
-
-    var adId: String {
-        switch self {
-        case .launch:
-            return GAD_ID_Launch
-        case .searchInsert:
-            return GAD_ID_Search_Insert
-        case .playInsert:
-            return GAD_ID_Play_Insert
-        case .downloadReward:
-            return GAD_ID_Download_Reward
-        case .playlist:
-            return GAD_ID_Playlist
-        case .pause:
-            return GAD_ID_Pause
-        case .unknow:
-            return ""
-        }
-    }
-
-    var adType: ADType {
-        switch self {
-        case .launch:
-            return .launch
-        case .searchInsert, .playInsert, .playlist,.pause:
-            return .interstitial
-        case .downloadReward:
-            return .reward
-        case .unknow:
-            return .unknow
-        }
-    }
-}

+ 0 - 50
TSLiveWallpaper/Business/AdMob/AppConfig.swift

@@ -1,50 +0,0 @@
-//
-//  AppConfig.swift
-//  PhysicalWallPaper
-//
-//  Created by nkl on 2024/12/16.
-//
-
-import Foundation
-
-class AppConfig {
-    static var appName: String = {
-        let appName = Bundle.main.infoDictionary?["CFBundleDisplayName"] as? String ?? "Dmanager"
-        return appName
-    }()
-    
-    static var appVersion: String = {
-        return Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? ""
-    }()
-    
-    static let appLanguage: String = {
-        let systemLanguages = UserDefaults.standard.value(forKey: "AppleLanguages")
-        var currentLanguage: String?
-        if let arr = systemLanguages as? [String] {
-            currentLanguage = arr.first
-        } else if let str = systemLanguages as? String {
-            currentLanguage = str
-        }
-        return currentLanguage ?? "en"
-    }()
-    
-    static var isChinaRegion: Bool {
-        let localeId = Locale.current.identifier
-        return localeId.contains("_CN")
-    }
-    
-    static var isEURegion : Bool {
-        let EURegions: Set<String> = [
-            "BE", "FR", "DE", "IT", "LU", "NL", "DK", "IE", "GB", "GR",
-            "PT", "ES", "AT", "FI", "SE", "CY", "CZ", "EE", "HU", "LV",
-            "LT", "MT", "PL", "SK", "SI", "RO", "BG",
-        ]
-
-        guard let currentRegionCode = Locale.current.regionCode else {
-            print("无法确定当前地区")
-            return false
-        }
-
-        return EURegions.contains(currentRegionCode)
-    }
-}

+ 0 - 62
TSLiveWallpaper/Business/AdMob/GoogleMobileAdsConsentManager.swift

@@ -1,62 +0,0 @@
-//
-//  GoogleMobileAdsConsentManager.swift
-//  PhysicalWallPaper
-//
-//  Created by nkl on 2024/12/16.
-//
-
-import Foundation
-import GoogleMobileAds
-import UserMessagingPlatform
-
-/// Google Mobile Ads SDK 提供了用户消息平台(Google 的 IAB 认证的同意管理平台)作为在受 GDPR 影响的国家获取用户同意的解决方案之一。这是一个示例,你可以选择另一个同意管理平台来获取同意。
-
-class GoogleMobileAdsConsentManager: NSObject {
-    static let shared = GoogleMobileAdsConsentManager()
-
-    var canRequestAds: Bool {
-        return UMPConsentInformation.sharedInstance.canRequestAds
-    }
-
-    var isPrivacyOptionsRequired: Bool {
-        return UMPConsentInformation.sharedInstance.privacyOptionsRequirementStatus == .required
-    }
-
-    /// 辅助方法,调用 UMP SDK 方法请求同意信息并加载/显示同意表单(如果需要)。
-    func gatherConsent(
-        from consentFormPresentationviewController: UIViewController,
-        consentGatheringComplete: @escaping (Error?) -> Void
-    ) {
-        let parameters = UMPRequestParameters()
-
-        // 用于测试目的,你可以强制设置 UMPDebugGeography 为 EEA 或非 EEA。
-        let debugSettings = UMPDebugSettings()
-        #if DEBUG
-        debugSettings.geography = UMPDebugGeography.EEA
-        #endif
-        parameters.debugSettings = debugSettings
-
-        
-        // 应该在每次应用启动时调用请求同意信息的更新。
-        UMPConsentInformation.sharedInstance.requestConsentInfoUpdate(with: parameters) {
-            requestConsentError in
-            guard requestConsentError == nil else {
-                return consentGatheringComplete(requestConsentError)
-            }
-            UMPConsentForm.loadAndPresentIfRequired(from: consentFormPresentationviewController) {
-                loadAndPresentError in
-
-                // 已获取同意。
-                consentGatheringComplete(loadAndPresentError)
-            }
-        }
-    }
-
-    /// 辅助方法,调用 UMP SDK 方法来呈现隐私选项表单。
-    func presentPrivacyOptionsForm(
-        from viewController: UIViewController, completionHandler: @escaping (Error?) -> Void
-    ) {
-        UMPConsentForm.presentPrivacyOptionsForm(
-            from: viewController, completionHandler: completionHandler)
-    }
-}

+ 1 - 1
TSLiveWallpaper/Business/TSMineVC/TSMineVC.swift

@@ -51,7 +51,7 @@ class TSMineVC: TSBaseVC {
             make.leading.trailing.bottom.equalTo(0)
             make.leading.trailing.bottom.equalTo(0)
         }
         }
 
 
-        let liveImageView = UIImageView.createImageView(imageName: "Cloud_Music_Pro")
+        let liveImageView = UIImageView.createImageView(imageName: "Old-Tim_pro")
         vipBgImageView.addSubview(liveImageView)
         vipBgImageView.addSubview(liveImageView)
         liveImageView.snp.makeConstraints { make in
         liveImageView.snp.makeConstraints { make in
             make.leading.equalTo(16)
             make.leading.equalTo(16)

+ 0 - 14
TSLiveWallpaper/Business/TSMusic/Consts/Consts.swift

@@ -1,14 +0,0 @@
-//
-//  Consts.swift
-//  ColorfulWallpaper
-//
-//  Created by nkl on 2024/9/11.
-//
-
-import Foundation
-
-extension Notification.Name {
-    static let K_RefreshNotifaction = Notification.Name("RefreshNotifaction")
-    static let K_ImportSuccessNotifaction = Notification.Name("ImportSuccessNotifaction")
-
-}

+ 0 - 64
TSLiveWallpaper/Business/TSMusic/Custom/BasePresentViewController.swift

@@ -1,64 +0,0 @@
-//
-//  BasePresentViewController.swift
-//  ColorfulWallpaper
-//
-//  Created by nkl on 2024/9/25.
-//
-
-import Foundation
-import UIKit
-
-class BasePresentViewController: LWBaseViewController {
-    override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) {
-        super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
-        self.modalPresentationStyle = .overFullScreen
-    }
-    
-    required init?(coder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-    
-    private let tapGesture = UITapGestureRecognizer()
-    override func viewDidLoad() {
-        super.viewDidLoad()
-        view.backgroundColor = alertBackgroundColor
-        
-        if shouldDismissWhenTapBackground {
-            tapGesture.addTarget(self, action: #selector(tapBackground))
-            tapGesture.delegate = self
-            view.addGestureRecognizer(tapGesture)
-        }
-    }
-    
-    @objc private func tapBackground() {
-        dismissPresent()
-    }
-    
-    var shouldDismissWhenTapBackground: Bool {
-        return false
-    }
-    
-    var alertBackgroundColor: UIColor {
-        return UIColor.black.withAlphaComponent(0.4)
-    }
-    
-    var animationContentView: UIView {
-        return view
-    }
-    
-    func dismissPresent() {
-        
-    }
-}
-
-extension BasePresentViewController: UIGestureRecognizerDelegate {
-    func gestureRecognizerShouldBegin(_ gestureRecognizer: UIGestureRecognizer) -> Bool {
-        if gestureRecognizer == tapGesture {
-            let point = gestureRecognizer.location(in: view)
-            if animationContentView.frame.contains(point) {
-                return false
-            }
-        }
-        return true
-    }
-}

+ 0 - 135
TSLiveWallpaper/Business/TSMusic/Custom/BubbleMenuView.swift

@@ -1,135 +0,0 @@
-//
-//  BubbleMenuView.swift
-//  PhysicalWallPaper
-//
-//  Created by nkl on 2024/11/13.
-//
-
-import Foundation
-import UIKit
-import KLExtension
-
-enum ImportSource {
-    case file // 文件
-    case library // 相册
-}
-
-class BubbleMenuView: UIView {
-    enum Position {
-        case topLeft
-        case topRight
-    }
-
-    lazy var stackView: UIStackView = {
-        let v = UIStackView()
-        v.axis = .vertical
-        v.alignment = .fill
-        v.distribution = .fill
-        return v
-    }()
-
-    lazy var videoButton = UIButton()
-    lazy var fileButton = UIButton()
-
-    var actionHanlder: ((ImportSource) -> Void)?
-    var position: Position = .topLeft
-
-    override init(frame: CGRect) {
-        super.init(frame: frame)
-        backgroundColor = .clear
-
-        addSubview(stackView)
-        stackView.snp.makeConstraints { make in
-            make.leading.equalTo(12)
-            make.trailing.equalTo(-12)
-            make.bottom.equalToSuperview()
-            make.top.equalTo(8)
-            make.width.equalTo(164)
-        }
-
-        stackView.addArrangedSubview(videoButton)
-        videoButton.snp.makeConstraints { make in
-            make.height.equalTo(44)
-        }
-
-        let line = UIView()
-        line.backgroundColor = .white.withAlphaComponent(0.2)
-        stackView.addArrangedSubview(line)
-        line.snp.makeConstraints { make in
-            make.height.equalTo(1)
-            make.width.equalTo(164)
-        }
-
-        stackView.addArrangedSubview(fileButton)
-        fileButton.snp.makeConstraints { make in
-            make.height.equalTo(44)
-        }
-
-        videoButton.setLocalizedImageAndTitle(image: UIImage(named: "ic-ring-import-video"), title: "From Photo".localized(), for: .normal)
-        videoButton.setTitleColor(.white, for: .normal)
-        videoButton.titleLabel?.font = .systemFont(ofSize: 14)
-
-        fileButton.setLocalizedImageAndTitle(image: UIImage(named: "ic-ring-import-file"), title: "From Files".localized(), for: .normal)
-        fileButton.setTitleColor(.white, for: .normal)
-        fileButton.titleLabel?.font = .systemFont(ofSize: 14)
-
-        videoButton.addTarget(self, action: #selector(buttonClick(_:)), for: .touchUpInside)
-        fileButton.addTarget(self, action: #selector(buttonClick(_:)), for: .touchUpInside)
-    }
-
-    required init?(coder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-
-    override func layoutSubviews() {
-        super.layoutSubviews()
-        drawPath()
-    }
-
-    func drawPath() {
-        guard frame.size != .zero else {
-            return
-        }
-
-        let path = UIBezierPath(roundedRect: CGRect(x: 0, y: stackView.y, width: width, height: stackView.frame.height), cornerRadius: 8)
-
-        switch position {
-        case .topLeft:
-            path.move(to: CGPoint(x: 24, y: stackView.y))
-            path.addLine(to: CGPoint(x: 24 + 8, y: 0))
-            path.addLine(to: CGPoint(x: 24 + 16, y: stackView.y))
-        case .topRight:
-            path.move(to: CGPoint(x: width - 10, y: stackView.y))
-            path.addLine(to: CGPoint(x: width - 10 - 8, y: 0))
-            path.addLine(to: CGPoint(x: width - 10 - 16, y: stackView.y))
-        }
-        path.close()
-
-        let shapeLayer = CAShapeLayer()
-        shapeLayer.fillColor = UIColor.black.cgColor
-        shapeLayer.path = path.cgPath
-        layer.insertSublayer(shapeLayer, at: 0)
-    }
-
-    @objc func buttonClick(_ sender: UIButton) {
-        switch sender {
-        case videoButton:
-            actionHanlder?(.library)
-        case fileButton:
-            actionHanlder?(.file)
-        default:
-            break
-        }
-    }
-
-    override func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? {
-        let view = super.hitTest(point, with: event)
-        if !bounds.contains(point) {
-            DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) {
-                self.removeFromSuperview()
-            }
-        }
-        return view
-    }
-}
-

+ 0 - 25
TSLiveWallpaper/Business/TSMusic/Custom/FitManager.swift

@@ -1,25 +0,0 @@
-//
-//  FitManager.swift
-//  PhysicalWallPaper
-//
-//  Created by nkl on 2024/11/13.
-//
-
-import Foundation
-import Localize_Swift
-
-class FitManager {
-    static var isAr: Bool {
-        let current = Localize.currentLanguage()
-        return current == "ar"
-    }
-
-    static var currentLanguage: String {
-        if let array = UserDefaults.standard.object(forKey: "AppleLanguages") as? [String] {
-            let lan = array.first ?? "en"
-            let final = lan.split(separator: "-").first ?? "en"
-            return String(final)
-        }
-        return "en"
-    }
-}

+ 0 - 70
TSLiveWallpaper/Business/TSMusic/Custom/ImageTextControl.swift

@@ -1,70 +0,0 @@
-//
-//  ImageTextControl.swift
-//  TSLiveWallpaper
-//
-//  Created by nkl on 2024/12/24.
-//
-
-import Foundation
-import UIKit
-
-class ImageTextControl: UIControl {
-    private lazy var imageView: UIImageView = {
-        let imageView = UIImageView()
-        imageView.contentMode = .scaleAspectFit
-        return imageView
-    }()
-
-    private lazy var titleLabel: UILabel = {
-        let label = UILabel()
-        label.textAlignment = .center
-        label.font = .systemFont(ofSize: 14)
-        label.numberOfLines = 0
-        return label
-    }()
-    
-    lazy var vStack : UIStackView = .vStack
-
-    var image: UIImage? {
-        didSet {
-            imageView.image = image
-        }
-    }
-
-    var text: String? {
-        didSet {
-            titleLabel.text = text
-        }
-    }
-
-    override init(frame: CGRect) {
-        super.init(frame: frame)
-        setupViews()
-    }
-
-    required init?(coder: NSCoder) {
-        super.init(coder: coder)
-        setupViews()
-    }
-
-    private func setupViews() {
-        vStack.isUserInteractionEnabled = false
-        addSubview(vStack)
-        vStack.addArrangedSubview(imageView)
-        vStack.addArrangedSubview(titleLabel)
-
-        vStack.snp.makeConstraints { make in
-            make.edges.equalToSuperview()
-        }
-        
-        imageView.snp.makeConstraints { make in
-            make.width.height.equalTo(24)
-        }
-    }
-
-    // 配置图片和文字
-    func configure(image: UIImage?, text: String?) {
-        self.image = image
-        self.text = text
-    }
-}

+ 0 - 75
TSLiveWallpaper/Business/TSMusic/Custom/ManageMenuAlertView.swift

@@ -1,75 +0,0 @@
-//
-//  ManageMenuAlertView.swift
-//  TSLiveWallpaper
-//
-//  Created by nkl on 2025/1/7.
-//
-
-import Foundation
-
-class ManageMenuAlertView: UIControl {
-    lazy var sortButton: UIButton = {
-        let btn = UIButton()
-        btn.setTitle("Sort By", for: .normal)
-        btn.setTitleColor(.black, for: .normal)
-        btn.setImage(.icNavSort, for: .normal)
-        // 调整图片和标题的间距
-        btn.imageEdgeInsets = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 5) // 右侧添加间距
-        btn.titleEdgeInsets = UIEdgeInsets(top: 0, left: 5, bottom: 0, right: 0) // 左侧添加间距
-        return btn
-    }()
-
-    lazy var manageButton: UIButton = {
-        let btn = UIButton()
-        btn.setTitle("Manage", for: .normal)
-        btn.setTitleColor(.black, for: .normal)
-        btn.setImage(.icNavManage, for: .normal)
-        // 调整图片和标题的间距
-        btn.imageEdgeInsets = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 5) // 右侧添加间距
-        btn.titleEdgeInsets = UIEdgeInsets(top: 0, left: 5, bottom: 0, right: 0) // 左侧添加间距
-        return btn
-    }()
-
-    lazy var bgView: UIView = .simpleView(color: .white)
-
-    lazy var vStack: UIStackView = .vStack
-
-    override init(frame: CGRect) {
-        super.init(frame: frame)
-        addChildren()
-        makeConstraints()
-    }
-
-    func addChildren() {
-        bgView.customCornerRadius = 20
-        addSubview(bgView)
-        bgView.addSubview(vStack)
-        vStack.addArrangedSubview(sortButton)
-        vStack.addArrangedSubview(manageButton)
-    }
-
-    func makeConstraints() {
-        bgView.snp.makeConstraints { make in
-            make.trailing.equalToSuperview().offset(-16)
-            make.top.equalToSuperview().offset(100)
-        }
-
-        vStack.snp.makeConstraints { make in
-            make.edges.equalToSuperview()
-        }
-
-        sortButton.snp.makeConstraints { make in
-            make.width.equalTo(125)
-            make.height.equalTo(48)
-        }
-
-        manageButton.snp.makeConstraints { make in
-            make.width.equalTo(125)
-            make.height.equalTo(48)
-        }
-    }
-
-    required init?(coder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-}

+ 0 - 102
TSLiveWallpaper/Business/TSMusic/Custom/MusicEmptyView.swift

@@ -1,102 +0,0 @@
-//
-//  MusicEmptyView.swift
-//  PhysicalWallPaper
-//
-//  Created by nkl on 2024/11/13.
-//
-
-import Foundation
-import UIKit
-
-enum MusicEmptyAlignment {
-    case top
-    case center
-    case bottom
-}
-
-class MusicEmptyView: UIView {
-    lazy var iconView: UIImageView = UIImageView(image: .icEmpty)
-
-    lazy var titleLabel: UILabel = UILabel.simpleLabel(text: "No Music".localized(), font: .systemFont14, color: .black)
-
-    lazy var jumpBtn: UIButton = {
-        let btn = UIButton()
-        btn.backgroundColor = .hexColor("#6EF4F4")
-        btn.setTitle("Go to Add".localized(), for: .normal)
-        btn.setTitleColor(.black, for: .normal)
-        btn.titleLabel?.font = .systemFont(ofSize: 16)
-        btn.customCornerRadius = 25
-        return btn
-    }()
-
-    lazy var containerView: UIView = .simpleView(color: .clear)
-
-    var alignment: MusicEmptyAlignment = .top
-
-    override init(frame: CGRect) {
-        super.init(frame: frame)
-    }
-
-    convenience init(title: String = "No Music".localized(),
-                     icon: UIImage? = UIImage(named: "ic_empty"),
-                     buttonTitle: String = "Go to Add".localized(),
-                     algin: MusicEmptyAlignment = .top,
-                     needButton: Bool = true
-    ) {
-        self.init(frame: .zero)
-        titleLabel.text = title
-        iconView.image = icon
-        iconView.contentMode = .scaleAspectFill
-        jumpBtn.setTitle(buttonTitle, for: .normal)
-        alignment = algin
-        jumpBtn.isHidden = !needButton
-
-        backgroundColor = .clear
-        addChildren()
-        makeConstraints()
-    }
-
-    func addChildren() {
-        addSubview(containerView)
-        containerView.addSubview(iconView)
-        containerView.addSubview(titleLabel)
-        containerView.addSubview(jumpBtn)
-    }
-
-    func makeConstraints() {
-        containerView.snp.makeConstraints { make in
-            if alignment == .top {
-                make.top.equalToSuperview().offset(100)
-                make.centerX.equalToSuperview()
-            } else if alignment == .center {
-                make.center.equalToSuperview()
-            } else if alignment == .bottom {
-                make.bottom.equalToSuperview().offset(-100)
-                make.centerX.equalToSuperview()
-            }
-        }
-
-        iconView.snp.makeConstraints { make in
-            make.top.equalToSuperview()
-            make.centerX.equalToSuperview()
-            make.width.height.equalTo(100)
-        }
-
-        titleLabel.snp.makeConstraints { make in
-            make.top.equalTo(iconView.snp.bottom).offset(20)
-            make.centerX.equalTo(iconView)
-        }
-
-        jumpBtn.snp.makeConstraints { make in
-            make.top.equalTo(titleLabel.snp.bottom).offset(20)
-            make.bottom.equalToSuperview()
-            make.leading.trailing.equalToSuperview()
-            make.height.equalTo(50)
-            make.width.equalTo(250)
-        }
-    }
-
-    required init?(coder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-}

+ 0 - 59
TSLiveWallpaper/Business/TSMusic/Custom/MusicSearchBar.swift

@@ -1,59 +0,0 @@
-//
-//  MusicSearchBar.swift
-//  PhysicalWallPaper
-//
-//  Created by nkl on 2024/11/13.
-//
-
-import Foundation
-import KLExtension
-import UIKit
-
-class MusicSearchBar: UIControl {
-    lazy var searchView: UIView = {
-        let v = UIView()
-        v.backgroundColor = .white.withAlphaComponent(0.1)
-        v.layer.cornerRadius = 12
-        v.layer.masksToBounds = true
-        v.isUserInteractionEnabled = false
-        return v
-    }()
-
-    lazy var iconView: UIImageView = .init(image: .iconSearch)
-
-    lazy var titleLabel: UILabel = .simpleLabel(text: "Search Music".localized(), font: .systemFont14, color: .white.withAlphaComponent(0.3))
-
-    override init(frame: CGRect) {
-        super.init(frame: frame)
-        addChildren()
-        makeCOnstraints()
-    }
-
-    func addChildren() {
-        addSubview(searchView)
-        searchView.addSubview(iconView)
-        searchView.addSubview(titleLabel)
-    }
-
-    func makeCOnstraints() {
-        searchView.snp.makeConstraints { make in
-            make.horizontalEdges.equalToSuperview()
-            make.verticalEdges.equalToSuperview().inset(4)
-        }
-        iconView.snp.makeConstraints { make in
-            make.leading.equalToSuperview().offset(16)
-            make.centerY.equalToSuperview()
-            make.width.height.equalTo(16)
-        }
-
-        titleLabel.snp.makeConstraints { make in
-            make.leading.equalTo(iconView.snp.trailing).offset(8)
-            make.trailing.equalToSuperview().offset(-16)
-            make.centerY.equalToSuperview()
-        }
-    }
-
-    required init?(coder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-}

+ 0 - 21
TSLiveWallpaper/Business/TSMusic/Custom/NotifactionKey.swift

@@ -1,21 +0,0 @@
-//
-//  NotifactionKey.swift
-//  ColorfulWallpaper
-//
-//  Created by nkl on 2023/11/9.
-//
-
-import Foundation
-
-/// 命名规则 kXxxxxxxNotifationName  字符串 “ kXxxxxxxNotifaction ”
-struct NotifactionKey {
-    static let kRefreshListNotifationName: Notification.Name = Notification.Name("RefreshListNotifaction")
-
-    static let kSuccessCachedNotifactionName: Notification.Name = Notification.Name("SuccessCachedNotifaction")
-
-    static let kVideoDidChangedNotifactionName: Notification.Name = Notification.Name("VideoDidChangedNotifactionName")
-    
-    static let kVideoStatusDidChangedNotifactionName: Notification.Name = Notification.Name("VideoStatusDidChangedNotifactionName")
-    
-    static let kPlayDetailUpdateNotifactionName: Notification.Name = Notification.Name("PlayDetailUpdateNotifactionName")
-}

+ 0 - 149
TSLiveWallpaper/Business/TSMusic/Custom/PlayMiniBar.swift

@@ -1,149 +0,0 @@
-//
-//  PlayMiniBar.swift
-//  ColorfulWallpaper
-//
-//  Created by nkl on 2024/2/23.
-//
-
-import Foundation
-import TSVideoKit
-import UIKit
-import MarqueeLabel
-
-class PlayMiniBar: UIView {
-    lazy var iconView: UIImageView = .simpleImage(imageName: "ic_default")
-    lazy var titleLabel: MarqueeLabel = {
-        let title: MarqueeLabel = .init(frame: CGRect(x: 0, y: 0, width: 300, height: 30))
-        title.trailingBuffer = 20
-        title.animationDelay = 0
-        title.speed = .duration(10)
-        title.font = .systemFont14
-        title.textAlignment = .left
-        title.textColor = .white
-        return title
-    }()
-    
-    lazy var bgImageView: UIView = UIView()
-    lazy var playButton: UIButton = {
-        let btn = UIButton()
-        btn.setImage(UIImage(named: "ic_detail_playBtn"), for: .normal)
-        btn.setImage(UIImage(named: "ic_detail_pauseBtn"), for: .selected)
-        return btn
-    }()
-
-    lazy var nextButton: UIButton = {
-        let btn = UIButton()
-        btn.setImage(UIImage(named: "ic_play_next"), for: .normal)
-        return btn
-    }()
-
-    override init(frame: CGRect) {
-        super.init(frame: frame)
-        addChildren()
-        addNotifaction()
-        makeConstraints()
-    }
-
-    func addNotifaction() {
-        NotificationCenter.default.addObserver(self, selector: #selector(updateMiniBarInfo), name: NotifactionKey.kVideoDidChangedNotifactionName, object: nil)
-        NotificationCenter.default.addObserver(self, selector: #selector(updateMiniBarStatus), name: NotifactionKey.kVideoStatusDidChangedNotifactionName, object: nil)
-    }
-
-    @objc func playButtonAction() {
-        /// 播放器没源,但是有当前播放歌曲
-        if PlayerManager.shared.player?.playControl.player.urlAsset == nil, let current = PlayerManager.shared.currentVideo {
-            PlayerManager.shared.playVideo(video: current, list: [], scene: .local, onceAdKey: "")
-        } else {
-            PlayerManager.shared.playOrPause()
-        }
-    }
-
-    @objc func playNextButtonAction() {
-        PlayerManager.shared.playNext()
-    }
-
-    @objc func updateMiniBarStatus() {
-    }
-
-    @objc func updateMiniBarInfo() {
-    }
-
-    func resetVideoInfo() {
-        iconView.contentMode = .scaleAspectFill
-        titleLabel.text = "Unknown".localized()
-        iconView.image = UIImage(named: "ic_default")
-        playButton.setImage(UIImage(named: "ic_detail_playBtn"), for: .normal)
-    }
-
-    func updateVideoInfo(video: TSVideo, state: PlayState) {
-        titleLabel.text = video.title
-//        titleLabel.speed = .duration(10)
-
-        let isPlaying = video.videoId == PlayerManager.shared.currentVideo?.videoId
-
-        if video.isOnline {
-            iconView.kf.setImage(with: video.iconUrl)
-        } else {
-            if let imageData = video.artwork {
-                iconView.image = UIImage(data: imageData)
-            } else {
-                iconView.image = UIImage(named: "ic_default")
-            }
-        }
-        if state == .pause {
-            playButton.setImage(UIImage(named: "ic_detail_playBtn"), for: .normal)
-        } else {
-            playButton.setImage(UIImage(named: "ic_detail_pauseBtn"), for: .normal)
-        }
-    }
-
-    func addChildren() {
-        iconView.customCornerRadius = 19
-        iconView.contentMode = .scaleAspectFill
-
-        playButton.addTarget(self, action: #selector(playButtonAction), for: .touchUpInside)
-        nextButton.addTarget(self, action: #selector(playNextButtonAction), for: .touchUpInside)
-        bgImageView.isUserInteractionEnabled = true
-        addSubview(bgImageView)
-        bgImageView.addSubview(iconView)
-        bgImageView.addSubview(titleLabel)
-        bgImageView.addSubview(playButton)
-        bgImageView.addSubview(nextButton)
-    }
-
-    func makeConstraints() {
-        bgImageView.snp.makeConstraints { make in
-            make.edges.equalToSuperview()
-        }
-        iconView.snp.makeConstraints { make in
-            make.leading.equalToSuperview().offset(12)
-            make.centerY.equalToSuperview()
-            make.width.height.equalTo(38)
-        }
-        titleLabel.snp.makeConstraints { make in
-            make.leading.equalTo(iconView.snp.trailing).offset(8)
-            make.centerY.equalToSuperview()
-            make.trailing.equalTo(playButton.snp.leading)
-        }
-        playButton.snp.makeConstraints { make in
-            make.trailing.equalTo(nextButton.snp.leading).offset(-16)
-            make.width.height.equalTo(24)
-            make.centerY.equalToSuperview()
-        }
-        nextButton.snp.makeConstraints { make in
-            make.trailing.equalToSuperview().offset(-16)
-            make.width.height.equalTo(24)
-            make.centerY.equalToSuperview()
-        }
-    }
-
-    override func layoutSubviews() {
-        super.layoutSubviews()
-
-        bgImageView.backgroundColor = .hexColor("#222222")
-    }
-
-    required init?(coder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-}

+ 0 - 92
TSLiveWallpaper/Business/TSMusic/Custom/THUD+CW.swift

@@ -1,92 +0,0 @@
-//
-//  THUD+CW.swift
-//  ColorfulWallpaper
-//
-//  Created by nkl on 2024/9/23.
-//
-
-import Foundation
-import UIKit
-
-extension THUD {
-    static func showLoading(_ message: String?,
-                            cancelHandler: (() -> Void)?) {
-        showLoading { config in
-            config.blur = true
-            config.stateMessage = message
-            config.actionTitle = "Cancel".localized()
-            config.actionHandler = { _ in
-                cancelHandler?()
-            }
-        }
-    }
-
-    static func showLoading(_ state: String?,
-                            message: String?) {
-        showLoading { config in
-            config.blur = true
-            config.stateMessage = state
-            config.descMessage = message
-        }
-    }
-
-    static func showLoading(_ stateImage: UIImage?,
-                            message: String?,
-                            actionHandler: ((Bool) -> Void)?) {
-        showLoading { config in
-            config.blur = true
-            config.stateImage = stateImage
-            config.descMessage = message
-            config.actionTitle = "Retry".localized()
-            config.actionHandler = actionHandler
-            config.closeable = true
-        }
-    }
-}
-
-// MARK: loading
-
-public extension THUD {
-    static func showLoading() {
-        showLoading { config in
-            config.backgroundColor = .hexColor("#232327")
-            config.minWidth = nil
-            config.loadingSize = CGSize(width: 32, height: 32)
-        }
-    }
-}
-
-// MARK: toast
-
-public extension THUD {
-    static func toast(_ message: String?,
-                      at position: THUD.Position = .top,
-                      in view: UIView? = nil,
-                      shake: Bool = false) {
-        guard let message = message, !message.isEmpty else { return }
-
-        var tipConfig = TipsViewConfig()
-        tipConfig.message = message
-        tipConfig.background = .hexColor("#2C2B2C")
-        tipConfig.textColor = .white
-        tipConfig.duration = 3.0
-        show(tipConfig, position: position, in: view)
-
-        if shake {
-            UIImpactFeedbackGenerator(style: .heavy).impactOccurred()
-        }
-    }
-}
-
-public extension THUD {
-    static func showLoading(_ configHandler: ((HUDConfig) -> Void)?) {
-        let config = HUDConfig()
-        configHandler?(config)
-
-        hide()
-        guard let superView = UIApplication.topViewController?.view else {
-            return
-        }
-        show(config, position: .center, in: superView)
-    }
-}

+ 0 - 100
TSLiveWallpaper/Business/TSMusic/Custom/THUD.swift

@@ -1,100 +0,0 @@
-//
-//  THUD.swift
-//  ClockWidget
-//
-//  Created by TSYH on 2024/3/8.
-//
-
-import UIKit
-//import ExtensionsKit
-import SnapKit
-
-public class THUD: NSObject {
-    public enum `Position` {
-        case top
-        case center
-        case bottom
-    }
-    
-    public static let shared = THUD()
-    private lazy var tipViews = [THUDViewProtocol]()
-    
-    private var currentViewController: UIViewController? {
-        return UIApplication.shared.delegate?.window??.rootViewController
-    }
-    
-    @discardableResult
-    public static func show(_ element: THUDProtocol,
-                            position: THUD.Position,
-                            in superView: UIView?) -> UIView? {
-        let view = element.hudView
-        // 去重
-        guard !shared.tipViews.contains(where: { $0.hudIdentifier == view.hudIdentifier }) else {
-            return view
-        }
-        shared.show(view: view, in: superView, at: position)
-        
-        if let duration = element.hudDuration, duration > 0 {
-            shared.perform(#selector(hide(identifier:)), with: view.hudIdentifier, afterDelay: duration)
-        }
-        return view
-    }
-    
-    public static func showTips(_ message: String,
-                         in view: UIView? = nil,
-                         style: TipsViewStyle = .normal,
-                         position: `Position` = .center,
-                         shakeType: UIImpactFeedbackGenerator.FeedbackStyle? = nil) {
-        
-        let tipsConfig = style.tipsConfig(message: message)
-        show(tipsConfig, position: position, in: view)
-        
-        if let type = shakeType {
-            UIImpactFeedbackGenerator(style: type).impactOccurred()
-        }
-    }
-    
-    public func show(view: THUDViewProtocol,
-                     in superView: UIView?,
-                     at position: `Position`) {
-        let superView = superView ?? currentViewController?.view
-        guard let superView = superView else { return }
-        
-        superView.addSubview(view)
-        view.snp.makeConstraints { make in
-            make.centerX.equalToSuperview()
-            switch position {
-            case .top:
-                make.centerY.equalToSuperview().multipliedBy(0.3)
-            case .center:
-                make.centerY.equalToSuperview()
-            case .bottom:
-                make.centerY.equalToSuperview().multipliedBy(1.6)
-            }
-            if view.frame.size != .zero {
-                make.size.equalTo(view.frame.size)
-            }
-        }
-        tipViews.append(view)
-    }
-    
-    public static func hide() {
-        shared.tipViews.forEach({ $0.removeFromSuperview() })
-        shared.tipViews.removeAll()
-    }
-    
-    public static func hide(_ identifier: String) {
-        shared.hide(identifier: identifier)
-    }
-}
-
-// MARK: private Method
-extension THUD {
-    @objc func hide(identifier: String) {
-        let views = tipViews.filter({ $0.hudIdentifier == identifier })
-        views.forEach { view in
-            view.removeFromSuperview()
-            tipViews.removeAll(where: { $0 == view })
-        }
-    }
-}

+ 0 - 20
TSLiveWallpaper/Business/TSMusic/Custom/THUDProtocol.swift

@@ -1,20 +0,0 @@
-//
-//  THUDProtocol.swift
-//  THUD
-//
-//  Created by TSYH on 2024/4/23.
-//
-
-import UIKit
-
-public protocol THUDProtocol {
-    // 视图View,其大小必须用约束,由subviews撑开,position则由THUD统一设置
-    var hudView: THUDViewProtocol { get }
-    
-    /// 显示时长,未nil,不自动隐藏,需手动调用hide
-    var hudDuration: TimeInterval? { get }
-}
-
-public protocol THUDViewProtocol where Self: UIView {
-    var hudIdentifier: String? { get }
-}

+ 0 - 125
TSLiveWallpaper/Business/TSMusic/Custom/TipsView.swift

@@ -1,125 +0,0 @@
-//
-//  TipsView.swift
-//  THUD
-//
-//  Created by TSYH on 2024/4/11.
-//
-
-import UIKit
-import SnapKit
-//import ExtensionsKit
-
-public enum TipsViewStyle {
-    case normal
-    case success
-    case warning
-}
-
-public struct TipsViewConfig: THUDProtocol {
-    public var iconName: String?
-    public var message: String?
-    public var background: UIColor?
-    public var textColor: UIColor?
-    public var duration: TimeInterval = 0
-    
-    public init() {
-        
-    }
-    
-    // MARK: THUDProtocol
-    public var hudView: THUDViewProtocol {
-        let v = TipsView()
-        v.config = self
-        return v
-    }
-    
-    public var hudDuration: TimeInterval? {
-        return duration
-    }
-}
-
-class TipsView: UIView, THUDViewProtocol {
-    lazy var iconView = UIImageView()
-    lazy var messageLabel = UILabel()
-    
-    override init(frame: CGRect) {
-        super.init(frame: frame)
-        customCornerRadius = 12
-        
-        messageLabel.numberOfLines = 0
-        messageLabel.font = UIFont.systemFont(ofSize: 14)
-        messageLabel.setContentCompressionResistancePriority(.required, for: .horizontal)
-        
-        let stackView = UIStackView(arrangedSubviews: [iconView, messageLabel])
-        stackView.axis = .horizontal
-        stackView.spacing = 10
-        stackView.alignment = .center
-        stackView.distribution = .fill
-        addSubview(stackView)
-        stackView.snp.makeConstraints { make in
-            make.left.equalTo(16)
-            make.right.equalTo(-16)
-            make.top.equalTo(16)
-            make.bottom.equalTo(-16)
-            make.width.lessThanOrEqualTo(280)
-        }
-        iconView.snp.makeConstraints { make in
-            make.width.height.equalTo(24)
-        }
-    }
-    
-    func setShadow() {
-        layer.shadowColor = UIColor.black.cgColor
-        layer.shadowOpacity = 0.1
-        layer.shadowRadius = 4
-        layer.shadowOffset = CGSize(width: 0, height: 2)
-    }
-    
-    required init?(coder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-    
-    var hudIdentifier: String? {
-        return messageLabel.text
-    }
-    
-    lazy var config: TipsViewConfig = TipsViewConfig() {
-        didSet {
-            updateUI(config: config)
-        }
-    }
-    
-    private func updateUI(config: TipsViewConfig) {
-        iconView.isHidden = true
-        if let imageName = config.iconName {
-            iconView.isHidden = false
-            iconView.image = UIImage(named: imageName)
-        }
-        backgroundColor = config.background
-        messageLabel.textColor = config.textColor
-        setShadow()
-        messageLabel.text = config.message
-    }
-}
-
-extension TipsViewStyle {
-    func tipsConfig(message: String) -> TipsViewConfig {
-        var config = TipsViewConfig()
-        config.message = message
-        config.duration = 5.0
-        switch self {
-        case .normal:
-            config.background = UIColor.black.withAlphaComponent(0.6)
-            config.textColor = .white
-        case .success:
-            config.background = .white
-            config.textColor = .black
-            config.iconName = "ic-hud-tip-success"
-        case .warning:
-            config.background = .white
-            config.textColor = .black
-            config.iconName = "ic-hud-tip-warning"
-        }
-        return config
-    }
-}

+ 0 - 206
TSLiveWallpaper/Business/TSMusic/Custom/ToastView.swift

@@ -1,206 +0,0 @@
-//
-//  ToastView.swift
-//  ColorfulWallpaper
-//
-//  Created by nkl on 2024/9/23.
-//
-
-import Foundation
-import UIKit
-
-public class HUDConfig: THUDProtocol {
-    var blur: Bool = false
-    var backgroundColor: UIColor?
-    
-    var minWidth: CGFloat? = 156
-    var loadingSize: CGSize = CGSize(width: 24, height: 24)
-    
-    // 状态
-    var stateMessage: String?
-    var stateImage: UIImage?
-    // 描述
-    var descMessage: String?
-    // 按钮
-    var actionTitle: String?
-    // 按钮事件,true:取消,false:按钮点击
-    var actionHandler: ((Bool) -> Void)?
-    var closeable: Bool = false
-    
-    public var hudView: THUDViewProtocol {
-        let v = ToastView(model: self)
-        if blur {
-            let blurView = ToastBlurView()
-            blurView.identifier = self.stateMessage
-            blurView.backgroundColor = UIColor.black.withAlphaComponent(0.4)
-            blurView.addSubview(v)
-            v.snp.makeConstraints { make in
-                make.center.equalToSuperview()
-            }
-            blurView.frame = UIScreen.main.bounds
-            return blurView
-        }
-        return v
-    }
-    
-    public var hudDuration: TimeInterval? {
-        return nil
-    }
-}
-
-class ToastBlurView: UIView, THUDViewProtocol {
-    var identifier: String?
-    
-    var hudIdentifier: String? {
-        return identifier
-    }
-}
-
-class ToastView: UIView, THUDViewProtocol {
-    lazy var loadingIV = UIImageView(image: UIImage(named: "ic-rotate-loading"))
-    lazy var stateImageView = UIImageView()
-    lazy var stateLabel = UILabel()
-    lazy var messageLabel = UILabel()
-    lazy var actionButton: UIButton = {
-        let bt = UIButton()
-        bt.setTitle("", for: .normal)
-        bt.setTitleColor(.white, for: .normal)
-        bt.titleLabel?.font = UIFont.systemFont(ofSize: 14)
-        bt.backgroundColor = UIColor.white.withAlphaComponent(0.1)
-        bt.customCornerRadius = 18
-        bt.addTarget(self, action: #selector(buttonClick(_:)), for: .touchUpInside)
-        return bt
-    }()
-    lazy var closeButton: UIButton = {
-        let bt = UIButton()
-        bt.setImage(UIImage(named: "ic-close"), for: .normal)
-        bt.addTarget(self, action: #selector(buttonClick(_:)), for: .touchUpInside)
-        bt.isHidden = true
-        return bt
-    }()
-    
-    lazy var model = HUDConfig()
-    required init(model: HUDConfig) {
-        super.init(frame: .zero)
-        self.model = model
-        
-        customCornerRadius = 16
-        backgroundColor = model.backgroundColor ?? .hexColor("#262626")
-        
-        let stackView = UIStackView(arrangedSubviews:
-                                        [loadingIV,
-                                         stateImageView,
-                                         stateLabel,
-                                         messageLabel,
-                                         actionButton])
-        stackView.axis = .vertical
-        stackView.spacing = 10
-        stackView.distribution = .fill
-        stackView.alignment = .center
-        addSubview(stackView)
-        stackView.snp.makeConstraints { make in
-            make.top.equalTo(16)
-            make.bottom.equalTo(-16)
-            if let width = model.minWidth {
-                make.width.greaterThanOrEqualTo(width)
-            }
-            make.left.equalTo(16)
-            make.right.equalTo(-16)
-        }
-        
-        loadingIV.contentMode = .scaleAspectFit
-        loadingIV.snp.makeConstraints { make in
-            make.size.equalTo(model.loadingSize)
-        }
-        
-        loadingIV.isHidden = model.stateImage != nil
-        stateImageView.isHidden = model.stateImage == nil
-        stateImageView.contentMode = .scaleAspectFit
-        stateImageView.snp.makeConstraints { make in
-            make.width.height.equalTo(30)
-        }
-        
-        stateLabel.isHidden = model.stateMessage?.isEmpty ?? true
-        stateLabel.snp.makeConstraints { make in
-            make.height.equalTo(18)
-        }
-        
-        messageLabel.isHidden = model.descMessage?.isEmpty ?? true
-        messageLabel.snp.makeConstraints { make in
-            make.height.equalTo(18)
-        }
-        
-        actionButton.isHidden = model.actionTitle == nil
-        actionButton.setTitle(model.actionTitle, for: .normal)
-        actionButton.snp.makeConstraints { make in
-            make.width.equalTo(100)
-            make.height.equalTo(36)
-        }
-        
-        closeButton.isHidden = !model.closeable
-        addSubview(closeButton)
-        closeButton.snp.makeConstraints { make in
-            make.top.equalTo(4)
-            make.right.equalTo(-4)
-            make.width.height.equalTo(24)
-        }
-        
-        stateImageView.image = model.stateImage
-        
-        stateLabel.font = .systemFont(ofSize: 12)
-        stateLabel.textColor = .white
-        stateLabel.text = model.stateMessage
-        
-        messageLabel.font = .systemFont(ofSize: 12)
-        messageLabel.textColor = .white
-        messageLabel.text = model.descMessage
-    }
-    
-    required init?(coder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-    
-    override func layoutSubviews() {
-        super.layoutSubviews()
-//        setGradient(colors: AppTheme.gradientAlphaColors, index: 0)
-    }
-    
-    override func didMoveToSuperview() {
-        super.didMoveToSuperview()
-        if superview != nil {
-            startLoadingAnimation()
-        } else {
-            loadingIV.layer.removeAllAnimations()
-        }
-    }
-    
-    @objc private func buttonClick(_ sender: UIButton) {
-        switch sender {
-        case actionButton:
-            model.actionHandler?(false)
-        case closeButton:
-            model.actionHandler?(true)
-        default:
-            break
-        }
-    }
-    
-    private func startLoadingAnimation() {
-        // 1.创建动画
-        let animation = CABasicAnimation(keyPath: "transform.rotation.z")
-        // 2.设置动画属性
-        animation.fromValue = 0 // 开始角度
-        animation.toValue = Double.pi * 2 // 结束角度
-        animation.repeatCount = .greatestFiniteMagnitude // 重复次数
-        animation.duration = 1
-        // 动画完成后自动重新开始,默认为NO
-        animation.autoreverses = false
-        // 默认是true,切换到其他控制器再回来,动画效果会消失,需要设置成false,动画就不会停了
-        animation.isRemovedOnCompletion = false
-        // 给需要旋转的view增加动画
-        loadingIV.layer.add(animation, forKey: nil)
-    }
-    
-    var hudIdentifier: String? {
-        return stateLabel.text
-    }
-}

+ 0 - 29
TSLiveWallpaper/Business/TSMusic/Detail/Controller/PlayDetailViewController+Ext.swift

@@ -1,29 +0,0 @@
-//
-//  PlayDetailViewController+Ext.swift
-//  ColorfulWallpaper
-//
-//  Created by ni on 2024/9/18.
-//
-
-import Foundation
-import SJVideoPlayer
-
-extension PlayDetailViewController: SJProgressSliderDelegate {
-    func sliderWillBeginDragging(_ slider: SJProgressSlider) {
-        playControl.pause()
-    }
-
-    func slider(_ slider: SJProgressSlider, valueDidChange value: CGFloat) {
-        
-        let durationTime = playControl.player.duration
-        let currentTime = durationTime * value
-        controlView.updateTime(currentTime: currentTime, duration: durationTime)
-    }
-
-    func sliderDidEndDragging(_ slider: SJProgressSlider) {
-        playControl.seekToProgress(progress: slider.value) { _ in
-            self.playControl.play()
-        }
-        
-    }
-}

+ 0 - 553
TSLiveWallpaper/Business/TSMusic/Detail/Controller/PlayDetailViewController.swift

@@ -1,553 +0,0 @@
-//
-//  PlayDetailViewController.swift
-//  ColorfulWallpaper
-//
-//  Created by nkl on 2024/9/13.
-//
-
-// import ADManager
-import Combine
-import Foundation
-import KLTips
-import MediaPlayer
-import SJVideoPlayer
-import TSVideoKit
-import UIKit
-
-class PlayDetailViewController: LWBGViewController {
-    var playControl: TSVideoPlayController {
-        if !(TSVideoOperator.shared.playerController.player.playbackController is SJIJKMediaPlaybackController) {
-            TSVideoOperator.shared.playerController.player.playbackController = SJIJKMediaPlaybackController()
-            TSVideoOperator.shared.playerController.player.isPausedInBackground = false
-            TSVideoOperator.shared.playerController.player.rotationManager?.isDisabledAutorotation = true
-            TSVideoOperator.shared.playerController.player.delayInSecondsForHiddenPlaceholderImageView = 0
-        }
-        return TSVideoOperator.shared.playerController
-    }
-
-    lazy var customLoading: SJLoadingView = SJLoadingView()
-
-    lazy var placeHolderView: PlayDetailPlaceHolderView = PlayDetailPlaceHolderView()
-
-    lazy var retryButton: UIButton = {
-        let btn = UIButton()
-        btn.setTitle("Reload", for: .normal)
-        btn.setTitleColor(.white, for: .normal)
-        btn.titleLabel?.font = .systemFont(ofSize: 14)
-        btn.customCornerRadius = 20
-        btn.isHidden = true
-        return btn
-    }()
-
-    lazy var topView: PlayDetailTopView = PlayDetailTopView()
-    lazy var controlView: PlayDetailControlView = PlayDetailControlView()
-    var downloader: NewChunkDownloader?
-    private var timer: Timer?
-    private var cancellable: [AnyCancellable] = []
-    private var downloaderCancellable: [AnyCancellable] = []
-
-    override func viewDidLoad() {
-        super.viewDidLoad()
-        bgImageView.image = .viewMainBg
-        playControl.view.backgroundColor = .clear
-
-        addNotifaction()
-        addActionTargets()
-    }
-
-    func updateNavibar(video: TSVideo?) {
-        if video?.videoStatus == .cached {
-            topView.moreButton.isHidden = false
-        } else {
-            topView.moreButton.isHidden = true
-        }
-    }
-
-    override func viewDidLayoutSubviews() {
-        super.viewDidLayoutSubviews()
-//        controlView.setRectCorner(corner:  [.topLeft, .topRight], radii: CGSize.init(width: 24, height: 24))
-        retryButton.setGradient(colors: [.hexColor("#72F4E6"), .hexColor("#374BEC")], index: 0)
-    }
-
-    override func addNotifaction() {
-        super.addNotifaction()
-        addPlayNotifaction()
-        addTaskNotifaction()
-        addSleepNotifacion()
-    }
-
-    func addSleepNotifacion() {
-        PlayerManager.shared.$sleepModel.receive(on: DispatchQueue.main).sink { [weak self] model in
-            guard let self = self else {
-                return
-            }
-            self.topView.timeButton.setTitle(model.countTime.hhmmss, for: .normal)
-            self.topView.timeButton.isSelected = model.isOpen
-
-        }.store(in: &cancellable)
-
-        NotificationCenter.default.addObserver(self, selector: #selector(updateLikeInfo), name: kDataChangedNotifactionName, object: nil)
-
-        NotificationCenter.default.addObserver(self, selector: #selector(retryAudio(notify:)), name: kSingleVideoFailNotifactionName, object: nil)
-    }
-
-    @objc func retryAudio(notify: Notification) {
-        if let videoId = notify.object as? String,
-           videoId == PlayerManager.shared.currentVideo?.videoId {
-            TSNewDownloadManager.shared.retryDownload(videoId: videoId, isAudio: true) { [weak self] downloader in
-                guard let self = self else { return }
-                self.downloader = downloader
-                self.updateDownloader(id: videoId)
-            }
-        }
-    }
-
-    func addPlayNotifaction() {
-        playControl.viewModel.$loadState.receive(on: DispatchQueue.main).sink { [weak self] state in
-            guard let self = self else { return }
-            self.loadingStateChangeHandler(state: state)
-        }.store(in: &cancellable)
-
-        playControl.viewModel.$currentTime.receive(on: DispatchQueue.main).sink { [weak self] timeValue in
-            guard let self = self else { return }
-            self.controlView.updateTime(currentTime: timeValue, duration: self.playControl.player.duration)
-
-        }.store(in: &cancellable)
-
-        playControl.viewModel.$playStatus.receive(on: DispatchQueue.main).sink { [weak self] status in
-            guard let self = self else { return }
-            self.playStatusChangeHandler(status)
-
-        }.store(in: &cancellable)
-
-        playControl.viewModel.$loopMode.receive(on: DispatchQueue.main).sink { [weak self] loop in
-            guard let self = self else { return }
-            self.controlView.playModelButton.setImage(UIImage(named: loop.icon), for: .normal)
-        }.store(in: &cancellable)
-
-        playControl.viewModel.$currentVideo.receive(on: DispatchQueue.main).dropFirst().scan((nil, nil)) { previous, current in
-            (previous.1, current)
-        }.sink { [weak self] oldValue, newValue in
-            guard let self = self else { return }
-
-            /// 即将播放的和正在播放的视频是同一个
-            if newValue != nil &&
-                oldValue?.videoId == newValue?.videoId {
-                PlayerManager.shared.showPlayerViewController()
-                return
-            }
-
-            if let mVideo = newValue {
-                self.controlView.updateVideoInfo(video: mVideo)
-                PlayerManager.shared.miniBar.updateVideoInfo(video: mVideo, state: .pause)
-                self.updateDownloader(id: mVideo.videoId ?? "")
-            } else {
-                self.controlView.resetVideoInfo()
-                self.controlView.resetProgress()
-                PlayerManager.shared.miniBar.resetVideoInfo()
-            }
-            self.updatePlaceHoderView(video: newValue, status: .stopped)
-            self.updateNavibar(video: newValue)
-            if let videoId = newValue?.videoId {
-                UserDefaults.standard.set(videoId, forKey: "LAST_PlAYED_VIDEO_ID")
-            }
-            NotificationCenter.default.post(name: kDataChangedNotifactionName, object: nil)
-        }.store(in: &cancellable)
-    }
-
-    func updatePlaceHoderView(video: TSVideo?, status: VLCMediaPlayerState) {
-        guard let mVideo = video else {
-            return
-        }
-        playControl.player.view.isHidden = false
-        if mVideo.isOnline {
-            placeHolderView.isHidden = true
-            playControl.player.presentView.placeholderImageView.kf.setImage(with: mVideo.iconUrl)
-        } else {
-            playControl.player.presentView.placeholderImageView.image = nil
-            if mVideo.isAudio {
-                placeHolderView.isHidden = false
-                placeHolderView.iconView.image = UIImage(named: "ic_default")
-                playControl.player.view.isHidden = true
-            } else {
-                placeHolderView.iconView.kf.setImage(with: mVideo.iconUrl)
-                if mVideo.videoStatus == .cached {
-                    placeHolderView.isHidden = true
-                } else {
-                    switch status {
-                    case .stopped, .opening:
-                        placeHolderView.isHidden = false
-                    default:
-                        placeHolderView.isHidden = true
-                    }
-                }
-            }
-        }
-    }
-
-    func loadingStateChangeHandler(state: TSLoadState) {
-        /// 展示状态
-        if state == .loading {
-            retryButton.isHidden = true
-            showLoading()
-        } else if state == .fail {
-            hideLoading()
-            retryButton.isHidden = false
-        } else if state == .success {
-            retryButton.isHidden = true
-            hideLoading()
-        } else {
-            retryButton.isHidden = true
-            hideLoading()
-        }
-
-        /// 按钮是否可用
-        if state == .loading {
-            controlView.playButton.playingState = .pause
-            controlView.playlistButton.isEnabled = false
-            controlView.progressView.isUserInteractionEnabled = false
-        } else {
-            controlView.playlistButton.isEnabled = true
-            controlView.progressView.isUserInteractionEnabled = true
-        }
-    }
-
-    fileprivate func playStatusChangeHandler(_ status: VLCMediaPlayerState) {
-        if status == .playing {
-            controlView.playButton.playingState = .playing
-            updatePlaceHoderView(video: playControl.viewModel.currentVideo, status: status)
-            if let video = playControl.viewModel.currentVideo {
-                PlayerManager.shared.miniBar.updateVideoInfo(video: video, state: .playing)
-            }
-        } else if status == .paused || status == .ended || status == .stopped {
-            controlView.playButton.playingState = .pause
-            if let video = playControl.viewModel.currentVideo {
-                PlayerManager.shared.miniBar.updateVideoInfo(video: video, state: .pause)
-            }
-        } else if status == .buffering {
-            /// 缓冲了展示loading
-            if !playControl.player.isPlaying && !controlView.progressView.isDragging {
-                showLoading()
-            } else {
-                hideLoading()
-            }
-        }
-    }
-
-    func addTaskNotifaction() {
-        // 单个完成回调
-        NotificationCenter.default.addObserver(self, selector: #selector(updateDownoloadStatus(notify:)), name: kGroupDownloadFinishNotifactionName, object: nil)
-    }
-
-    func updateDownloader(id: String) {
-        if let downloader = TSNewDownloadManager.shared.fetchDownloader(identifier: id) {
-            downloaderCancellable.removeAll()
-            self.downloader = downloader
-            downloader.$progress.receive(on: DispatchQueue.main).sink { [weak self] progress in
-                self?.controlView.downloadButton.progressView.set(progress: Double(progress))
-            }.store(in: &downloaderCancellable)
-
-            downloader.$downloadState.receive(on: DispatchQueue.main).sink { state in
-                self.controlView.setDownloadButtonStates(status: state)
-            }.store(in: &downloaderCancellable)
-        } else {
-            downloaderCancellable.removeAll()
-            downloader = nil
-            if let video = TSVideoOperator.shared.dataManager.fetchVideo(videoId: id) {
-                controlView.setDownloadButtonStates(status: video.videoStatus.asChunkDownloadStatus)
-            } else {
-                controlView.setDownloadButtonStates(status: .idle)
-            }
-        }
-    }
-
-    @objc func updateDownoloadStatus(notify: Notification) {
-        if let videoId = notify.object as? String,
-           let video = TSVideoOperator.shared.dataManager.fetchVideo(videoId: videoId),
-           let currentVideo = TSVideoOperator.shared.playerViewModel.currentVideo {
-            if videoId == currentVideo.videoId {
-                controlView.setDownloadButtonStates(status: video.videoStatus.asChunkDownloadStatus)
-            }
-        }
-    }
-
-    @objc func showMoreOperation() {
-        let vc = CWOperateViewController(types: [.like, .addPlaylist, .share, .deleteVideo])
-        vc.modalPresentationStyle = .overFullScreen
-        vc.operteItem = playControl.viewModel.currentVideo
-        PlayerManager.shared.rootVc?.present(vc, animated: true)
-    }
-
-    func countDownTime() {
-        timer?.invalidate()
-        timer = nil
-        PlayerManager.shared.sleepModel.isOpen = true
-        timer = Timer.scheduledTimer(withTimeInterval: 1.0, repeats: true) { _ in
-            PlayerManager.shared.sleepModel.countTime -= 1
-
-            if PlayerManager.shared.sleepModel.countTime < 1 {
-                /// 倒计时结束,暂停播放器
-                self.playControl.pause()
-                self.stopTimer()
-            }
-        }
-    }
-
-    func stopTimer() {
-        PlayerManager.shared.sleepModel.isOpen = false
-        PlayerManager.shared.sleepModel.countTime = 0
-        timer?.invalidate()
-        timer = nil
-    }
-
-    func addActionTargets() {
-        topView.backButton.addTarget(self, action: #selector(swapDown), for: .touchUpInside)
-        topView.timeButton.addTarget(self, action: #selector(showSleepTimeController), for: .touchUpInside)
-        topView.moreButton.addTarget(self, action: #selector(showMoreOperation), for: .touchUpInside)
-
-        controlView.playButton.addTarget(self, action: #selector(playButtonAction), for: .touchUpInside)
-        controlView.listButton.addTarget(self, action: #selector(playlistButtonAction), for: .touchUpInside)
-        controlView.nextButton.addTarget(self, action: #selector(nextButtonAction), for: .touchUpInside)
-        controlView.lastButton.addTarget(self, action: #selector(lastButtonAction), for: .touchUpInside)
-        controlView.playModelButton.addTarget(self, action: #selector(playModeButtonAction), for: .touchUpInside)
-        controlView.downloadButton.addTarget(self, action: #selector(downloadButtonAction), for: .touchUpInside)
-        controlView.playlistButton.addTarget(self, action: #selector(addToPlaylistAction), for: .touchUpInside)
-        controlView.favouriteButton.addTarget(self, action: #selector(favouriteButtonAction), for: .touchUpInside)
-        retryButton.addTarget(self, action: #selector(reloadVideo), for: .touchUpInside)
-        controlView.progressView.tappedExeBlock = { [weak self] _, progress in
-
-            self?.controlView.progressView.value = progress
-            let durationTime = (self?.playControl.player.duration ?? 0)
-            let currentTime = durationTime * progress
-            print("duration---\(durationTime),current ---- \(currentTime)")
-            self?.controlView.updateTime(currentTime: currentTime, duration: durationTime)
-            self?.playControl.pause()
-            self?.playControl.seekToProgress(progress: progress) { [weak self] _ in
-                self?.playControl.play()
-            }
-        }
-        // 创建下滑手势识别器
-        let swipeDownGesture = UISwipeGestureRecognizer(target: self, action: #selector(swapDown))
-        swipeDownGesture.direction = .down
-
-        // 添加手势识别器到 myView
-        view.addGestureRecognizer(swipeDownGesture)
-    }
-
-    @objc func reloadVideo() {
-        playControl.viewModel.reloadCurrentVideo()
-    }
-
-    override func addChildren() {
-        super.addChildren()
-        controlView.progressView.delegate = self
-        placeHolderView.isHidden = true
-        addChild(playControl)
-        view.addSubview(topView)
-        view.addSubview(playControl.view)
-        view.addSubview(controlView)
-        view.addSubview(placeHolderView)
-        view.addSubview(customLoading)
-        view.addSubview(retryButton)
-        view.bringSubviewToFront(topView)
-    }
-
-    override func makeConstarints() {
-        super.makeConstarints()
-        topView.snp.makeConstraints { make in
-            make.top.equalTo(view.safeAreaLayoutGuide.snp.top)
-            make.leading.trailing.equalToSuperview()
-            make.height.equalTo(44)
-        }
-        let vRadio = UIScreen.kScreenHeight / 896.0
-        playControl.view.snp.makeConstraints { make in
-            make.top.equalTo(topView.snp.bottom).offset(100 * vRadio)
-            make.leading.trailing.equalToSuperview()
-            make.height.equalTo(playControl.view.snp.width).multipliedBy(9.0 / 16.0)
-        }
-
-        retryButton.snp.makeConstraints { make in
-            make.center.equalTo(playControl.view)
-            make.height.equalTo(40)
-            make.width.equalTo(100)
-        }
-
-        customLoading.snp.makeConstraints { make in
-            make.center.equalTo(playControl.view)
-        }
-
-        placeHolderView.iconView.contentMode = .scaleAspectFit
-        placeHolderView.snp.makeConstraints { make in
-            make.top.equalTo(topView.snp.bottom).offset(100 * vRadio)
-            make.leading.trailing.equalToSuperview()
-            make.height.equalTo(playControl.view.snp.width).multipliedBy(9.0 / 16.0)
-        }
-
-        controlView.snp.makeConstraints { make in
-            make.leading.trailing.bottom.equalToSuperview()
-            make.bottom.equalTo(view.safeAreaLayoutGuide.snp.bottom).offset(-40)
-        }
-    }
-}
-
-//
-/// targets
-extension PlayDetailViewController {
-    @objc func swapDown() {
-        PlayerManager.shared.hiddePlayerViewController()
-    }
-
-    @objc func playButtonAction() {
-        /// 播放器没源,但是有当前播放歌曲
-        if PlayerManager.shared.player?.playControl.player.urlAsset == nil, let current = PlayerManager.shared.currentVideo {
-            PlayerManager.shared.playVideo(video: current, list: [], scene: .local, onceAdKey: "")
-        } else {
-            PlayerManager.shared.playOrPause()
-        }
-    }
-
-    @objc func playlistButtonAction() {
-        let vc = PlayDetailListViewContoller()
-        vc.viewModel.videos = playControl.viewModel.currentVideos
-        vc.viewModel.recommendDatas = playControl.viewModel.recommendDatas
-        vc.viewModel.playScene = playControl.viewModel.scene
-        vc.modalPresentationStyle = .overFullScreen
-        present(vc, animated: true)
-    }
-
-    @objc func nextButtonAction() {
-        if FitManager.isAr {
-            playControl.playLast()
-        } else {
-            playControl.playNext()
-        }
-    }
-
-    @objc func lastButtonAction() {
-        if FitManager.isAr {
-            playControl.playNext()
-        } else {
-            playControl.playLast()
-        }
-    }
-
-    @objc func playModeButtonAction() {
-        playControl.viewModel.loopMode = playControl.viewModel.loopMode.nextMode()
-        THUD.toast(playControl.viewModel.loopMode.rawValue, at: .center)
-    }
-
-    @objc func favouriteButtonAction() {
-        if let video = TSVideoOperator.shared.playerViewModel.currentVideo {
-            if video.isFavorite {
-                TSVideoOperator.shared.dataManager.dislikeCurrentVideo { _ in
-                    updateLikeInfo()
-                }
-            } else {
-                TSVideoOperator.shared.dataManager.likeCurrentVideo { _ in
-                    updateLikeInfo()
-                }
-            }
-        }
-    }
-
-    @objc func updateLikeInfo() {
-        if let video = TSVideoOperator.shared.playerViewModel.currentVideo {
-            controlView.favouriteButton.isSelected = video.isFavorite
-        }
-    }
-
-    @objc func downloadButtonAction(sender: DownloadButton) {
-        if let video = TSVideoOperator.shared.playerViewModel.currentVideo,
-           let videoId = video.videoId {
-            switch sender.downloadState {
-            case .idle(isAnimate: false), .idle(isAnimate: true):
-                if PurchaseManager.default.isVip {
-                    TSNewDownloadManager.shared.downloadVideo(videoId: videoId, isAudio: false) { [weak self] downloader in
-                        self?.downloader = downloader
-                        self?.updateDownloader(id: videoId)
-                    }
-                } else {
-                    let loading = ADLoadingViewController()
-                    loading.adScene = .downloadReward
-                    loading.finishedHandler = { [weak self] finished in
-                        if finished {
-                            TSNewDownloadManager.shared.downloadVideo(videoId: videoId, isAudio: false) { [weak self] downloader in
-                                self?.downloader = downloader
-                                self?.updateDownloader(id: videoId)
-                            }
-                        }
-                    }
-                    PlayerManager.shared.rootVc?.present(loading, animated: false)
-                }
-                break
-            case .pause:
-                TSNewDownloadManager.shared.resumeTask(id: videoId) { [weak self] downloader in
-                    self?.downloader = downloader
-                    self?.updateDownloader(id: videoId)
-                }
-
-            case .downloading:
-                TSNewDownloadManager.shared.pauseTask(id: videoId) { [weak self] downloader in
-                    self?.downloader = downloader
-                    self?.updateDownloader(id: videoId)
-                }
-
-            case .retry:
-                TSNewDownloadManager.shared.retryDownload(videoId: videoId, isAudio: false) { [weak self] downloader in
-                    self?.downloader = downloader
-                    self?.updateDownloader(id: videoId)
-                }
-                break
-            default:
-                break
-            }
-        }
-    }
-
-    // 调用这个方法来显示加载圈
-    func showLoading() {
-        customLoading.start()
-    }
-
-    // 调用这个方法来隐藏加载圈
-    func hideLoading() {
-        customLoading.stop()
-    }
-
-    @objc func addToPlaylistAction() {
-        if let video = TSVideoOperator.shared.playerViewModel.currentVideo {
-            let addVc: AddPlayListViewController = AddPlayListViewController(video: video)
-            addVc.addSuccessBlock = {
-                THUD.toast("Added Successfully".localized())
-            }
-            addVc.modalPresentationStyle = .overFullScreen
-            PlayerManager.shared.rootVc?.present(addVc, animated: true)
-        }
-    }
-
-    @objc func showSleepTimeController() {
-        let times: [Int] = [15, 30, 60, 90, 120]
-        // 创建 UIAlertController 实例
-        let alertController = UIAlertController(title: nil, message: nil, preferredStyle: .actionSheet)
-
-        for time in times {
-            let option = UIAlertAction(title: "\(time) minutes", style: .default) { [weak self] _ in
-                PlayerManager.shared.sleepModel.countTime = Double(time) * 60.0
-                self?.countDownTime()
-            }
-            alertController.addAction(option)
-        }
-
-        // 添加关闭按钮
-        let offAction = UIAlertAction(title: "Turn Off".localized(), style: .default) { _ in
-            self.stopTimer()
-        }
-        offAction.setValue(UIColor.red, forKey: "titleTextColor")
-        alertController.addAction(offAction)
-
-        let cancelAction = UIAlertAction(title: "Cancel".localized(), style: .cancel) { _ in }
-        alertController.addAction(cancelAction)
-
-        present(alertController, animated: true, completion: nil)
-    }
-}

+ 0 - 206
TSLiveWallpaper/Business/TSMusic/Detail/Controller/SleepTimeViewController.swift

@@ -1,206 +0,0 @@
-//
-//  SleepTimeViewController.swift
-//  ColorfulWallpaper
-//
-//  Created by nkl on 2024/9/26.
-//
-
-import Combine
-import Foundation
-import KLExtension
-
-let kSleepModelKey = "SleepModelKey"
-
-class SleepTimeViewController: LWBaseViewController, UIPickerViewDataSource, UIPickerViewDelegate {
-    lazy var bgView: UIView = .simpleView(color: .hexColor("#01143C"))
-    lazy var titleLabel: UILabel = .simpleLabel(text: "Sleep Mode".localized(), font: .boldSystemFont18, color: .white)
-    lazy var dismissControl: UIControl = {
-        let control = UIControl()
-        control.addTarget(self, action: #selector(dismissCurrentVc), for: .touchUpInside)
-        return control
-    }()
-
-    lazy var switchButton: UISwitch = {
-        let btn = UISwitch()
-        btn.onTintColor = UIColor.hexColor("#56A4E9")
-        btn.addTarget(self, action: #selector(startSleepCountDown(sender:)), for: .valueChanged)
-        return btn
-    }()
-
-    lazy var customPickerView: UIPickerView = {
-        let pick = UIPickerView()
-        pick.dataSource = self
-        pick.delegate = self
-        return pick
-    }()
-
-    lazy var timeView: UIButton = {
-        let btn = UIButton()
-        btn.setTitle("00:00:00", for: .normal)
-        btn.setTitleColor(.white, for: .normal)
-        btn.titleLabel?.font = .systemFont(ofSize: 18)
-        btn.setImage(UIImage(named: "ic_clock_time_large"), for: .normal)
-        let spacing: CGFloat = 10.0
-        btn.imageEdgeInsets = UIEdgeInsets(top: 0, left: -spacing / 2, bottom: 0, right: spacing / 2)
-        btn.titleEdgeInsets = UIEdgeInsets(top: 0, left: spacing / 2, bottom: 0, right: -spacing / 2)
-        btn.contentEdgeInsets = UIEdgeInsets(top: 0, left: spacing / 2, bottom: 0, right: spacing / 2)
-        return btn
-    }()
-
-    let hours = Array(0 ... 23)
-    let minutes = Array(0 ... 59)
-
-    private var cancellables: [AnyCancellable] = []
-
-    override func viewDidLoad() {
-        super.viewDidLoad()
-        view.backgroundColor = .black.withAlphaComponent(0.6)
-        addNotifaction()
-
-        /// 默认为1分钟
-        if PlayerManager.shared.sleepModel.countTime == 0 {
-            PlayerManager.shared.sleepModel.countTime = 0
-        }
-    }
-
-    @objc func startSleepCountDown(sender: UISwitch) {
-        if PlayerManager.shared.sleepModel.countTime == 0 {
-            sender.isOn = false
-            return
-        }
-        PlayerManager.shared.sleepModel.isOpen = sender.isOn
-        if sender.isOn {
-            PlayerManager.shared.player?.countDownTime()
-        } else {
-            PlayerManager.shared.player?.stopTimer()
-        }
-        dismissCurrentVc()
-    }
-
-    func selectTime(time: TimeInterval) {
-        timeView.setTitle(time.hhmmss, for: .normal)
-        let hour = Int(time) / 3600
-        let minute = (Int(time) % 3600) / 60
-        if let index = hours.firstIndex(of: hour) {
-            customPickerView.selectRow(index, inComponent: 0, animated: false)
-        } else {
-            customPickerView.selectRow(0, inComponent: 0, animated: false)
-        }
-        if let minIndex = minutes.firstIndex(of: minute) {
-            customPickerView.selectRow(minIndex, inComponent: 1, animated: false)
-        } else {
-            customPickerView.selectRow(0, inComponent: 1, animated: false)
-        }
-    }
-
-    override func addNotifaction() {
-        super.addNotifaction()
-        PlayerManager.shared.$sleepModel.receive(on: DispatchQueue.main).sink { model in
-            self.selectTime(time: model.countTime)
-            self.switchButton.isOn = model.isOpen
-        }.store(in: &cancellables)
-    }
-
-    override func addChildren() {
-        super.addChildren()
-        view.addSubview(bgView)
-        view.addSubview(dismissControl)
-        bgView.addSubview(titleLabel)
-        bgView.addSubview(switchButton)
-        bgView.addSubview(customPickerView)
-        bgView.addSubview(timeView)
-    }
-
-    override func makeConstarints() {
-        super.makeConstarints()
-
-        dismissControl.snp.makeConstraints { make in
-            make.top.leading.trailing.equalToSuperview()
-            make.bottom.equalTo(bgView.snp.top)
-        }
-
-        bgView.snp.makeConstraints { make in
-            make.leading.trailing.equalToSuperview()
-            make.bottom.equalToSuperview()
-        }
-
-        titleLabel.snp.makeConstraints { make in
-            make.leading.equalToSuperview().offset(16)
-            make.bottom.equalTo(timeView.snp.top).offset(-30)
-            make.top.equalToSuperview().offset(30)
-        }
-
-        switchButton.snp.makeConstraints { make in
-            make.trailing.equalToSuperview().offset(-16)
-            make.centerY.equalTo(titleLabel)
-        }
-
-        timeView.snp.makeConstraints { make in
-            make.bottom.equalTo(customPickerView.snp.top).offset(-30)
-            make.centerX.equalToSuperview()
-        }
-
-        customPickerView.snp.makeConstraints { make in
-            make.leading.trailing.equalToSuperview()
-            make.bottom.equalToSuperview().offset(-(view.safeAreaInsets.bottom + 20))
-        }
-    }
-
-    @objc func dismissCurrentVc() {
-        dismiss(animated: true)
-    }
-
-    // MARK: - UIPickerViewDataSource
-
-    func numberOfComponents(in pickerView: UIPickerView) -> Int {
-        return 2 // 两个组件:小时和分钟
-    }
-
-    func pickerView(_ pickerView: UIPickerView, numberOfRowsInComponent component: Int) -> Int {
-        if component == 0 {
-            return hours.count // 小时的行数
-        } else {
-            return minutes.count // 分钟的行数
-        }
-    }
-
-    // MARK: - UIPickerViewDelegate
-
-    func pickerView(_ pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -> String? {
-        if component == 0 {
-            return "\(hours[row]) hours" // 显示小时
-        } else {
-            return String(format: "%2d min", minutes[row]) // 显示分钟
-        }
-    }
-
-    func pickerView(_ pickerView: UIPickerView, didSelectRow row: Int, inComponent component: Int) {
-        let selectedHour = pickerView.selectedRow(inComponent: 0)
-        let selectedMinute = pickerView.selectedRow(inComponent: 1)
-
-        let totalScends = hours[selectedHour] * 60 * 60 + minutes[selectedMinute] * 60
-        PlayerManager.shared.sleepModel.countTime = TimeInterval(totalScends)
-        print("Selected time: \(hours[selectedHour]):\(minutes[selectedMinute])")
-    }
-
-    func pickerView(_ pickerView: UIPickerView, rowHeightForComponent component: Int) -> CGFloat {
-        40
-    }
-
-    func pickerView(_ pickerView: UIPickerView, viewForRow row: Int, forComponent component: Int, reusing view: UIView?) -> UIView {
-        let label = (view as? UILabel) ?? UILabel()
-        if component == 0 {
-            label.text = "\(hours[row]) hours"
-        } else {
-            label.text = String(format: "%2d min", minutes[row])
-        }
-        label.textAlignment = .center
-        label.font = .boldSystemFont(ofSize: 18)
-        label.textColor = .white // 自定义文字颜色
-        return label
-    }
-
-    deinit {
-        cancellables.removeAll()
-    }
-}

+ 0 - 230
TSLiveWallpaper/Business/TSMusic/Detail/PlayerManager.swift

@@ -1,230 +0,0 @@
-//
-//  PlayRootManager.swift
-//  ColorfulWallpaper
-//
-//  Created by nkl on 2024/9/13.
-//
-
-import ADManager
-// import ADManager
-import Foundation
-import KLTips
-import TSVideoKit
-
-struct SleepModel: Codable {
-    var isOpen: Bool = false
-    var countTime: TimeInterval = 0
-}
-
-extension LoopMode {
-    var icon: String {
-        switch self {
-        case .cyclic:
-            return "ic_cycle"
-        case .random:
-            return "ic_shuffle"
-        case .repeat:
-            return "ic_single"
-        }
-    }
-}
-
-class PlayerManager {
-    static let shared: PlayerManager = .init()
-    @Published var sleepModel: SleepModel = .init()
-    var showedPlayAd: Bool = false
-
-    var selectedVideos: [TSVideo] = []
-    var removePlaylist: TSPlayList?
-    /// 广告池
-    var adPool: [String] = []
-
-    var currentLoopMode: LoopMode {
-        player?.playControl.viewModel.loopMode ?? .cyclic
-    }
-
-    var rootVc: TSTabBarController? {
-        if let vc = UIApplication.shared.windows.first?.rootViewController as? TSTabBarController {
-            return vc
-        }
-        return nil
-    }
-
-    var miniBar: PlayMiniBar {
-        if let vc = UIApplication.shared.windows.first?.rootViewController as? TSTabBarController {
-            return vc.miniBar
-        }
-        return .init()
-    }
-
-    var player: PlayDetailViewController? {
-        if let vc = UIApplication.shared.windows.first?.rootViewController as? TSTabBarController {
-            return vc.playerVc
-        }
-        return nil
-    }
-
-    var currentVideo: TSVideo? {
-        player?.playControl.viewModel.currentVideo
-    }
-
-    func hiddePlayerViewController() {
-        if let tabVc = UIApplication.shared.windows.first?.rootViewController as? TSTabBarController {
-            tabVc.hidePlayerVc()
-        }
-    }
-
-    func showPlayerViewController() {
-        if let tabVc = UIApplication.shared.windows.first?.rootViewController as? TSTabBarController {
-            tabVc.showPlayerVc()
-        }
-    }
-
-    func playOrPause() {
-        guard let player = player else {
-            return
-        }
-        /// 非vip且非国区,暂停要出广告
-        if !PurchaseManager.default.isVip,
-           player.playControl.player.isPlaying,
-           let rootVc = rootVc {
-            rootVc.presentingViewController?.dismiss(animated: false)
-            ADManager.shared.showAd(scene: ADScene.pause, from: rootVc)
-        }
-        player.playControl.pauseOrPlay()
-    }
-
-    func pause() {
-        player?.playControl.pause()
-    }
-
-    func play() {
-        player?.playControl.play()
-    }
-
-    func nextPlayModel() {
-        player?.playControl.viewModel.loopMode = player?.playControl.viewModel.loopMode.nextMode() ?? .cyclic
-    }
-
-    func playNext() {
-        if FitManager.isAr {
-            player?.playControl.playLast()
-        } else {
-            player?.playControl.playNext()
-        }
-    }
-
-    func playLast() {
-        if FitManager.isAr {
-            player?.playControl.playNext()
-        } else {
-            player?.playControl.playLast()
-        }
-    }
-
-    func playVideo(video: TSVideo, list: [TSVideo], scene: TSPlayScene, onceAdKey: String) {
-        if needShowOnceAd(key: onceAdKey),
-           let vc = rootVc,
-           !PurchaseManager.default.isVip {
-            ADManager.shared.showAd(scene: ADScene.playInsert, from: vc) { state in
-                if state == .finished || state == .fail {
-                    self.adPool.append(onceAdKey)
-                    self.showPlayerViewController()
-                    self.player?.playControl.playVideo(video: video, list: list, scene: scene)
-                }
-            }
-        } else {
-            showPlayerViewController()
-            player?.playControl.playVideo(video: video, list: list, scene: scene)
-        }
-    }
-
-    func playVideo(onlineVideo: VideoOnlineModel, recommendDatas: [VideoOnlineModel], scene: TSPlayScene) {
-        showPlayerViewController()
-        player?.playControl.playOnlineVideo(video: onlineVideo, recommendDaras: recommendDatas, scene: scene)
-    }
-
-    func showMutiOperateView(isFromPlaylist: Bool, playlist: TSPlayList? = nil) {
-        rootVc?.showMultiSelectView()
-    }
-
-    func hideMutiOperateView() {
-        rootVc?.hideMultiSelectView()
-    }
-
-    func needShowOnceAd(key: String) -> Bool {
-        if key.isEmpty {
-            return false
-        }
-        return !adPool.contains(key)
-    }
-
-    @objc func addVideosToPlaylist() {
-        if selectedVideos.isEmpty {
-            return
-        }
-        let vc = AddPlayListViewController(videos: selectedVideos)
-        vc.addSuccessBlock = {
-//            KLTips.showAutoHidden("Added Successfully".localized())
-            THUD.toast("Added Successfully".localized())
-            PlayerManager.shared.hideMutiOperateView()
-            /// 发送刷新通知
-            NotificationCenter.default.post(name: .K_RefreshNotifaction, object: nil)
-        }
-        vc.modalPresentationStyle = .overFullScreen
-        PlayerManager.shared.rootVc?.present(vc, animated: true)
-    }
-
-    @objc func deleteSelectedVideos() {
-        if selectedVideos.isEmpty {
-            return
-        }
-
-        let ac = UIAlertController(title: nil,
-                                   message: "Are you sure to delete".localized(), preferredStyle: .alert)
-        ac.addAction(UIAlertAction(title: "Cancel".localized(), style: .cancel))
-        ac.addAction(UIAlertAction(title: "Delete".localized(), style: .destructive, handler: { _ in
-
-            /// 删除当前歌曲
-            if self.selectedVideos.contains(where: {
-                $0.videoId == TSVideoOperator.shared.playerViewModel.currentVideo?.videoId
-            }) {
-                TSVideoOperator.shared.playerController.player.stop()
-                TSVideoOperator.shared.playerViewModel.currentVideo = nil
-            }
-
-            /// 删除播放列表歌曲
-            let videoIds: [String] = self.selectedVideos.compactMap {
-                $0.videoId
-            }
-
-            let needRestart = videoIds.contains { id in
-                id == TSVideoOperator.shared.playerViewModel.currentVideo?.videoId
-            }
-
-            TSVideoOperator.shared.dataManager.deleteVideos(videos: self.selectedVideos) { _ in
-
-                PlayerManager.shared.hideMutiOperateView()
-
-                for item in videoIds {
-                    TSVideoOperator.shared.playerViewModel.currentVideos.removeAll { $0.isFault }
-                }
-                // 播放删完列表后的第一首
-                let newVideos = TSVideoOperator.shared.playerViewModel.currentVideos
-                if let video = newVideos.first {
-                    if needRestart {
-                        /// 播放的时候回刷新列表不用重复刷
-                        TSVideoOperator.shared.playerController.playVideo(video: video, list: newVideos, scene: .local)
-                    }
-                    /// 发送刷新通知
-                    NotificationCenter.default.post(name: .K_RefreshNotifaction, object: nil)
-                } else {
-                    /// 发送刷新通知
-                    NotificationCenter.default.post(name: .K_RefreshNotifaction, object: nil)
-                }
-            }
-
-        }))
-        PlayerManager.shared.rootVc?.present(ac, animated: true)
-    }
-}

+ 0 - 301
TSLiveWallpaper/Business/TSMusic/Detail/View/PlayDetailControlView.swift

@@ -1,301 +0,0 @@
-//
-//  PlayDetailControlView.swift
-//  ColorfulWallpaper
-//
-//  Created by nkl on 2024/9/13.
-//
-import Foundation
-import Kingfisher
-import MarqueeLabel
-import SJVideoPlayer
-import TSVideoKit
-import UIKit
-
-class PlayDetailControlView: UIView {
-    lazy var titleLabel: MarqueeLabel = {
-        let title: MarqueeLabel = .init(frame: CGRect(x: 0, y: 0, width: 300, height: 30))
-        title.trailingBuffer = 20
-        title.animationDelay = 0
-        title.speed = .duration(10)
-        title.font = .boldSystemFont20
-        title.textAlignment = .center
-        title.textColor = .white
-        return title
-    }()
-
-    lazy var detailLabel: UILabel = .simpleLabel(text: "--", font: .systemFont14, color: .white, align: .center)
-
-    lazy var topHStack: UIStackView = .hStack
-
-    lazy var favouriteButton: UIButton = {
-        let btn = UIButton()
-        btn.setImage(UIImage(named: "ic_like"), for: .normal)
-        btn.setImage(UIImage(named: "ic_like_s"), for: .selected)
-        return btn
-    }()
-
-    lazy var playlistButton: UIButton = {
-        let btn = UIButton()
-        btn.setImage(UIImage(named: "ic_detail_addPlaylist"), for: .normal)
-        btn.isHidden = true
-        return btn
-    }()
-
-    lazy var lastButton: UIButton = {
-        let btn = UIButton()
-        btn.setLocalizedImage(UIImage(named: "ic_play_last"), for: .normal)
-        return btn
-    }()
-
-    lazy var playButton: PlayButtonView = PlayButtonView()
-
-    lazy var nextButton: UIButton = {
-        let btn = UIButton()
-        btn.setLocalizedImage(UIImage(named: "ic_play_next"), for: .normal)
-        return btn
-    }()
-
-    lazy var progressView: SJProgressSlider = {
-        let progress = SJProgressSlider()
-        progress.trackHeight = 4
-        progress.thumbImageView.image = UIImage(named: "ic_image_thubnail")
-        progress.trackImageView.backgroundColor = .white.withAlphaComponent(0.1)
-        progress.traceImageView.backgroundColor = .hexColor("#12FFF7")
-        progress.traceImageView.contentMode = .scaleAspectFill
-        progress.isRound = true
-        progress.animaMaxDuration = 0
-        progress.tap.isEnabled = true
-        return progress
-    }()
-
-    lazy var currentLabel: UILabel = .simpleLabel(text: "00:00", font: .systemFont12, color: .hexColor("#B8B9C1"))
-    lazy var durationLabel: UILabel = .simpleLabel(text: "00:00", font: .systemFont12, color: .hexColor("#B8B9C1"))
-
-    lazy var videoHStack: UIStackView = {
-        let stack: UIStackView = .hStack
-        stack.distribution = .fillEqually
-        return stack
-    }()
-
-    lazy var downloadButton: DownloadButton = {
-        let btn = DownloadButton()
-        btn.downloadState = .idle(isAnimate: false)
-        btn.isHidden = true
-        return btn
-    }()
-
-    lazy var playModelButton: UIButton = {
-        let btn = UIButton()
-        btn.setImage(UIImage(named: "ic_cycle"), for: .normal)
-        return btn
-    }()
-
-    lazy var listButton: UIButton = {
-        let btn = UIButton()
-        btn.setImage(UIImage(named: "ic_playdetail_list"), for: .normal)
-        return btn
-    }()
-
-    lazy var hStackView: UIStackView = {
-        let stack: UIStackView = .hStack
-        stack.distribution = .equalSpacing
-        return stack
-    }()
-
-    lazy var adTag: UIImageView = {
-        let tag = UIImageView(image: UIImage(named: "detail_ad_tag"))
-        tag.isHidden = false
-        return tag
-    }()
-
-    override init(frame: CGRect) {
-        super.init(frame: frame)
-        addChildren()
-        makeConstraints()
-    }
-
-    public func updateTime(currentTime: TimeInterval, duration: TimeInterval) {
-        let value = currentTime / duration
-        progressView.value = value
-        currentLabel.text = currentTime.mmsshh
-        durationLabel.text = duration.mmsshh
-    }
-
-    public func updateVideoInfo(video: TSVideo) {
-        titleLabel.text = video.title
-        detailLabel.text = video.artist
-
-        playlistButton.isHidden = video.videoStatus != .cached
-        downloadButton.isHidden = video.videoStatus == .cached
-        favouriteButton.isHidden = video.videoStatus != .cached
-        setDownloadButtonStates(status: video.videoStatus.asChunkDownloadStatus)
-        downloadButton.progressView.set(progress: Double(video.progress))
-        favouriteButton.isSelected = video.isFavorite
-    }
-
-    public func resetVideoInfo() {
-        titleLabel.text = "--"
-        detailLabel.text = "--"
-        playlistButton.isHidden = true
-        downloadButton.isHidden = true
-    }
-
-    func resetProgress() {
-        progressView.value = 0
-        currentLabel.text = "00:00"
-        durationLabel.text = "00:00"
-    }
-
-    public func updateProgress(_ progress: Float) {
-        downloadButton.progressView.set(progress: Double(progress))
-    }
-
-    public func setDownloadButtonStates(status: ChunkDownloadStatus) {
-        switch status {
-        case .idle, .cancel:
-            downloadButton.downloadState = .idle(isAnimate: false)
-            playlistButton.isHidden = true
-            downloadButton.isHidden = false
-            downloadButton.adTag.isHidden = PurchaseManager.default.isVip
-        case .prasing:
-            downloadButton.downloadState = .loading
-            playlistButton.isHidden = true
-            downloadButton.isHidden = false
-        case .praseSuccess:
-            break
-        case .downloading:
-            downloadButton.downloadState = .downloading
-            playlistButton.isHidden = true
-            downloadButton.isHidden = false
-        case .pause:
-            downloadButton.downloadState = .pause
-            playlistButton.isHidden = true
-            downloadButton.isHidden = false
-        case .failed:
-            downloadButton.downloadState = .retry
-            playlistButton.isHidden = true
-            downloadButton.isHidden = false
-        case .finished:
-            /// 完成,隐藏进度条,展示下载按钮,按钮状态设置为更多
-            downloadButton.downloadState = .idle(isAnimate: false)
-            playlistButton.isHidden = false
-            downloadButton.isHidden = true
-            favouriteButton.isHidden = false
-        }
-    }
-
-    public func setDefaultDownloadStatus() {
-        downloadButton.downloadState = .idle(isAnimate: false)
-        downloadButton.progressView.set(progress: 0)
-    }
-
-    private func addChildren() {
-        titleLabel.textAlignment = .left
-        detailLabel.textAlignment = .left
-        addSubview(titleLabel)
-        addSubview(detailLabel)
-        detailLabel.text = ""
-
-        addSubview(topHStack)
-        topHStack.addArrangedSubview(downloadButton)
-        topHStack.addArrangedSubview(playlistButton)
-        topHStack.addArrangedSubview(favouriteButton)
-
-        addSubview(progressView)
-        addSubview(currentLabel)
-        addSubview(durationLabel)
-
-        addSubview(videoHStack)
-        videoHStack.addArrangedSubview(playModelButton)
-        videoHStack.addArrangedSubview(lastButton)
-        videoHStack.addArrangedSubview(playButton)
-        videoHStack.addArrangedSubview(nextButton)
-        videoHStack.addArrangedSubview(listButton)
-    }
-
-    private func makeConstraints() {
-        let vRadio = UIScreen.kScreenHeight / 896.0
-
-        titleLabel.snp.makeConstraints { make in
-            make.leading.equalToSuperview().inset(16)
-            make.trailing.equalTo(topHStack.snp.leading).offset(-12)
-            make.top.equalToSuperview()
-        }
-
-        detailLabel.snp.makeConstraints { make in
-            make.leading.equalToSuperview().inset(16)
-            make.trailing.equalTo(topHStack.snp.leading).offset(-12)
-            make.top.equalTo(titleLabel.snp.bottom).offset(12 * vRadio)
-        }
-
-        topHStack.snp.makeConstraints { make in
-            make.trailing.equalToSuperview().offset(-16)
-            make.centerY.equalTo(titleLabel.snp.bottom)
-        }
-        downloadButton.snp.makeConstraints { make in
-            make.width.height.equalTo(44)
-        }
-        playlistButton.snp.makeConstraints { make in
-            make.width.height.equalTo(44)
-        }
-        favouriteButton.snp.makeConstraints { make in
-            make.width.height.equalTo(44)
-        }
-
-        progressView.snp.makeConstraints { make in
-            make.leading.equalToSuperview().offset(16)
-            make.trailing.equalToSuperview().offset(-16)
-            make.top.equalTo(detailLabel.snp.bottom).offset(44 * vRadio)
-            make.height.equalTo(50)
-        }
-
-        currentLabel.snp.makeConstraints { make in
-            if FitManager.isAr {
-                make.trailing.equalTo(progressView)
-            } else {
-                make.leading.equalTo(progressView)
-            }
-
-            make.bottom.equalTo(progressView.snp.top).offset(14)
-        }
-
-        durationLabel.snp.makeConstraints { make in
-            if FitManager.isAr {
-                make.leading.equalTo(progressView)
-            } else {
-                make.trailing.equalTo(progressView)
-            }
-            make.bottom.equalTo(progressView.snp.top).offset(14 * vRadio)
-        }
-
-        videoHStack.snp.makeConstraints { make in
-            make.top.equalTo(progressView.snp.bottom).offset(20 * vRadio)
-            make.leading.trailing.equalToSuperview()
-            make.bottom.equalToSuperview()
-        }
-
-        lastButton.snp.makeConstraints { make in
-            make.width.height.equalTo(70)
-        }
-
-        playButton.snp.makeConstraints { make in
-            make.width.height.equalTo(70)
-        }
-
-        nextButton.snp.makeConstraints { make in
-            make.width.height.equalTo(70)
-        }
-
-        playModelButton.snp.makeConstraints { make in
-            make.width.height.equalTo(64)
-        }
-
-        listButton.snp.makeConstraints { make in
-            make.width.height.equalTo(64)
-        }
-    }
-
-    required init?(coder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-}

+ 0 - 38
TSLiveWallpaper/Business/TSMusic/Detail/View/PlayDetailPlaceHolderView.swift

@@ -1,38 +0,0 @@
-//
-//  PlayDetailPlaceHolderView.swift
-//  ColorfulWallpaper
-//
-//  Created by nkl on 2024/9/13.
-//
-
-import Foundation
-import UIKit
-
-class PlayDetailPlaceHolderView: UIView {
-    lazy var iconView: UIImageView = UIImageView(image: .icMusicPlaceholder)
-
-    override init(frame: CGRect) {
-        super.init(frame: frame)
-        iconView.contentMode = .scaleAspectFill
-        addChildren()
-        makeConstraints()
-    }
-
-    func addChildren() {
-        addSubview(iconView)
-    }
-
-    func makeConstraints() {
-        iconView.snp.makeConstraints { make in
-            make.edges.equalToSuperview()
-        }
-    }
-
-    required init?(coder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-
-    override func layoutSubviews() {
-        super.layoutSubviews()
-    }
-}

+ 0 - 91
TSLiveWallpaper/Business/TSMusic/Detail/View/PlayDetailTopView.swift

@@ -1,91 +0,0 @@
-//
-//  PlayDetailTopView.swift
-//  ColorfulWallpaper
-//
-//  Created by nkl on 2024/9/13.
-//
-
-import Foundation
-import UIKit
-
-class PlayDetailTopView: UIView {
-    lazy var backButton: UIButton = {
-        let btn = UIButton()
-        btn.setImage(UIImage(named: "ic_dismiss"), for: .normal)
-        return btn
-    }()
-
-    lazy var hStack: UIStackView = {
-        let stack: UIStackView = .hStack
-        stack.alignment = .center
-        return stack
-    }()
-
-    lazy var timeButton: UIButton = {
-        let button = UIButton()
-        button.frame = CGRect(x: 0, y: 0, width: 100, height: 32)
-        button.backgroundColor = .white.withAlphaComponent(0.2)
-        button.customCornerRadius = 16
-        button.setTitle("00:00:00", for: .normal)
-        button.setTitleColor(.white.withAlphaComponent(0.5), for: .normal)
-        button.setTitleColor(.white, for: .selected)
-        button.titleLabel?.font = .systemFont(ofSize: 12)
-        button.setImage(UIImage(named: "ic_clock_time"), for: .normal)
-        button.setImage(UIImage(named: "ic_clock_time_selected"), for: .selected)
-        let spacing: CGFloat = 10.0
-        button.imageEdgeInsets = UIEdgeInsets(top: 0, left: -spacing / 2, bottom: 0, right: spacing / 2)
-        button.titleEdgeInsets = UIEdgeInsets(top: 0, left: spacing / 2, bottom: 0, right: -spacing / 2)
-        button.contentEdgeInsets = UIEdgeInsets(top: 0, left: spacing / 2, bottom: 0, right: spacing / 2)
-        button.contentMode = .scaleAspectFit
-        if  FitManager.isAr {
-            button.semanticContentAttribute = .forceLeftToRight
-        }
-
-        return button
-    }()
-
-    lazy var moreButton: UIButton = {
-        let button = UIButton()
-        button.setImage(UIImage(named: "ic_nav_more"), for: .normal)
-        return button
-    }()
-
-    override init(frame: CGRect) {
-        super.init(frame: frame)
-        addChildren()
-        makeConstraints()
-    }
-
-    private func addChildren() {
-        
-        addSubview(backButton)
-        addSubview(hStack)
-        moreButton.isHidden = true
-        hStack.addArrangedSubview(timeButton)
-        hStack.addArrangedSubview(moreButton)
-    }
-
-    private func makeConstraints() {
-        backButton.snp.makeConstraints { make in
-            make.leading.equalToSuperview().offset(16)
-            make.width.height.equalTo(44)
-        }
-
-        hStack.snp.makeConstraints { make in
-            make.trailing.equalToSuperview().offset(-12)
-            make.centerY.equalToSuperview()
-            make.height.equalToSuperview()
-        }
-        timeButton.snp.makeConstraints { make in
-            make.width.equalTo(100)
-            make.height.equalTo(32)
-        }
-        moreButton.snp.makeConstraints { make in
-            make.width.height.equalTo(44)
-        }
-    }
-
-    required init?(coder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-}

+ 0 - 62
TSLiveWallpaper/Business/TSMusic/Helper/CWCustomProgressView.swift

@@ -1,62 +0,0 @@
-//
-//  CWCustomProgressView.swift
-//  ColorfulWallpaper
-//
-//  Created by nkl on 2024/9/10.
-//
-
-import Foundation
-import UIKit
-
-class CWCustomProgressView: UIView {
-    lazy var progressTitle: UILabel = {
-        let label = UILabel()
-        label.textAlignment = .center
-        label.font = UIFont.systemFont(ofSize: 10, weight: .medium)
-        label.textColor = .hexColor("#12FFF7")
-        label.text = "0%"
-        return label
-    }()
-
-    lazy var progressView: CWProgressView = {
-        let progress = CWProgressView(frame: .init(x: 0, y: 0, width: 36, height: 36), colors: UIColor.hexColor("#B3FFAB"), UIColor.hexColor("#12FFF7"))
-        progress.trackColor = .clear
-        progress.startAngle = -90
-        return progress
-    }()
-
-    override init(frame: CGRect) {
-        super.init(frame: frame)
-        addChildren()
-        makeConstraint()
-    }
-
-    func addChildren() {
-        addSubview(progressTitle)
-        addSubview(progressView)
-    }
-
-    func makeConstraint() {
-        progressView.snp.makeConstraints { make in
-            make.edges.equalToSuperview()
-        }
-
-        progressTitle.snp.makeConstraints { make in
-            make.center.equalToSuperview()
-        }
-    }
-
-    func set(progress: Double) {
-        if progress.isFinite {
-            progressTitle.text = "\(Int(progress * 100))%"
-            progressView.progress = progress
-        } else {
-            progressTitle.text = "0%"
-            progressView.progress = 0
-        }
-    }
-
-    required init?(coder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-}

+ 0 - 53
TSLiveWallpaper/Business/TSMusic/Helper/CWLoadingView.swift

@@ -1,53 +0,0 @@
-//
-//  CWLoadingView.swift
-//  ColorfulWallpaper
-//
-//  Created by nkl on 2024/9/11.
-//
-
-import Foundation
-import UIKit
-
-class CWLoadingView: UIView {
-    lazy var activityIndicator: UIActivityIndicatorView = {
-        let activityIndicator = UIActivityIndicatorView(style: .medium)
-        activityIndicator.color = .white
-        return activityIndicator
-    }()
-        
-    fileprivate var topOffset: CGFloat = 20
-
-
-    override init(frame: CGRect) {
-        super.init(frame: frame)
-        addChildren()
-        makeConstraints()
-        startLoading()
-        
-    }
-
-    public func startLoading() {
-        activityIndicator.startAnimating()
-    }
-
-    public func stopLoading() {
-        activityIndicator.stopAnimating()
-    }
-
-    private func addChildren() {
-        addSubview(activityIndicator)
-    }
-
-    private func makeConstraints() {
-        activityIndicator.snp.makeConstraints { make in
-            make.width.height.equalTo(50)
-            make.centerX.equalToSuperview()
-            make.top.equalToSuperview().offset(self.topOffset)
-        }
-    }
-
-    required init?(coder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-}
-

+ 0 - 44
TSLiveWallpaper/Business/TSMusic/Helper/CWMutiSelectOpeateView.swift

@@ -1,44 +0,0 @@
-//
-//  CWMutiSelectOpeateView.swift
-//  ColorfulWallpaper
-//
-//  Created by nkl on 2024/9/23.
-//
-
-import Foundation
-import UIKit
-
-class CWMutiSelectOpeateView: UIView {
-    lazy var hStack: UIStackView = {
-        let stack: UIStackView = .hStack
-        stack.distribution = .fillEqually
-        return stack
-    }()
-
-    lazy var deleteButton: CWOperateButton = .init(title: "Delete".localized(), imgName: "ic_delete")
-    lazy var addPlaylist: CWOperateButton = .init(title: "Add to Playlist".localized(), imgName: "ic_multi_addPlaylist")
-
-    override init(frame: CGRect) {
-        super.init(frame: frame)
-        backgroundColor = .hexColor("#262626")
-        addChildren()
-        makeConstraints()
-    }
-
-    func addChildren() {
-        addSubview(hStack)
-        hStack.addArrangedSubview(deleteButton)
-        hStack.addArrangedSubview(addPlaylist)
-    }
-
-    func makeConstraints() {
-        hStack.snp.makeConstraints { make in
-            make.top.equalToSuperview().offset(20)
-            make.leading.trailing.equalToSuperview()
-        }
-    }
-
-    required init?(coder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-}

+ 0 - 50
TSLiveWallpaper/Business/TSMusic/Helper/CWOperateItemView.swift

@@ -1,50 +0,0 @@
-//
-//  CWOperateItemView.swift
-//  ColorfulWallpaper
-//
-//  Created by ni on 2024/9/19.
-//
-
-import Foundation
-import UIKit
-
-class CWOperateItemView: UIControl {
-    lazy var iconView: UIImageView = .simpleImage(imageName: "")
-    lazy var titleLabel: UILabel = .simpleLabel(text: "", font: .systemFont14, color: .white)
-    var type: CWOperateType = .like
-    override init(frame: CGRect) {
-        super.init(frame: frame)
-        addChildren()
-        makeConstraints()
-    }
-
-    convenience init(imgName: String, title: String, type: CWOperateType) {
-        self.init(frame: .zero)
-        iconView.image = .init(named: imgName)
-        titleLabel.text = title
-        self.type = type
-    }
-
-    func addChildren() {
-        addSubview(iconView)
-        addSubview(titleLabel)
-    }
-
-    func makeConstraints() {
-        iconView.snp.makeConstraints { make in
-            make.leading.equalToSuperview().offset(16)
-            make.width.height.equalTo(28)
-            make.verticalEdges.equalToSuperview().inset(18)
-        }
-
-        titleLabel.snp.makeConstraints { make in
-            make.leading.equalTo(iconView.snp.trailing).offset(12)
-            make.trailing.equalToSuperview().offset(-16)
-            make.centerY.equalTo(iconView)
-        }
-    }
-
-    required init?(coder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-}

+ 0 - 152
TSLiveWallpaper/Business/TSMusic/Helper/CWOperateViewController+Ext.swift

@@ -1,152 +0,0 @@
-//
-//  CWOperateViewController+Ext.swift
-//  ColorfulWallpaper
-//
-//  Created by ni on 2024/9/19.
-//
-
-import Foundation
-import KLTips
-import TSVideoKit
-
-extension CWOperateViewController {
-    func addTargets() {
-        disAppearArea.addTarget(self, action: #selector(dismissCurrentVc), for: .touchUpInside)
-        likeItem.addTarget(self, action: #selector(likeVideoAction(sender:)), for: .touchUpInside)
-        addPlaylistItem.addTarget(self, action: #selector(addToPlayList), for: .touchUpInside)
-        shareItem.addTarget(self, action: #selector(shareApp), for: .touchUpInside)
-        deleteItem.addTarget(self, action: #selector(deleteVideoAction), for: .touchUpInside)
-        removeFromPlaylist.addTarget(self, action: #selector(removeSongFromPlaylist), for: .touchUpInside)
-    }
-
-    @objc func likeVideoAction(sender: CWOperateItemView) {
-        dismiss(animated: true) {
-            if let mVideo = self.operteItem {
-                if mVideo.isFavorite {
-                    TSVideoOperator.shared.dataManager.dislikeVideo(video: mVideo) { _ in
-                        self.updateLikeInfo(item: sender)
-                        NotificationCenter.default.post(name: .K_RefreshNotifaction, object: nil)
-                    }
-                } else {
-                    TSVideoOperator.shared.dataManager.likeVideo(video: mVideo) { _ in
-                        self.updateLikeInfo(item: sender)
-                        NotificationCenter.default.post(name: .K_RefreshNotifaction, object: nil)
-                    }
-                }
-            }
-        }
-    }
-
-    @objc func removeSongFromPlaylist() {
-        dismiss(animated: true) {
-            if let list = self.playlist, let item = self.operteItem {
-                TSVideoOperator.shared.dataManager.removeVideosFromPlaylist(videos: [item], from: list) { _ in
-                    THUD.toast("Removed Successfully".localized())
-                    NotificationCenter.default.post(name: .K_RefreshNotifaction, object: nil)
-                }
-            }
-        }
-    }
-
-    @objc func addToPlayList() {
-        if let mVideo = operteItem {
-            let addVc: AddPlayListViewController = AddPlayListViewController(video: mVideo)
-            addVc.addSuccessBlock = { [weak self] in
-                NotificationCenter.default.post(name: kDataChangedNotifactionName, object: nil)
-                self?.dismiss(animated: true, completion: {
-                    THUD.toast("Added Successfully".localized())
-                })
-            }
-            addVc.modalPresentationStyle = .overFullScreen
-            present(addVc, animated: true)
-        }
-    }
-
-    @objc func shareApp() {
-        dismiss(animated: true) {
-            let httpAppStoreLink = "https://apps.apple.com/app/id\(TSConfig.appid)"
-            let text = ""
-            let url = URL(string: httpAppStoreLink)!
-            let image = UIImage(named: "App-Icon")!
-            let vc = UIActivityViewController(activityItems: [image, text, url], applicationActivities: nil)
-            vc.completionWithItemsHandler = { activity, value, _, error in
-                if let type = activity, type == .copyToPasteboard {
-                    UIPasteboard.general.string = httpAppStoreLink
-                }
-            }
-        
-            if UIDevice.isPad {
-                if let popover = vc.popoverPresentationController {
-                    popover.sourceView = self.view // 设置锚点视图
-                    popover.sourceRect = CGRect(x: self.view.bounds.midX, y: self.view.bounds.midY, width: 0, height: 0) // 设置弹窗位置为屏幕中心
-                    popover.permittedArrowDirections = [] // 禁止箭头指向
-                }
-            }
-    
-            PlayerManager.shared.rootVc?.present(vc, animated: true)
-        }
-    }
-
-    /// finish.kailen
-    @objc func deleteVideoAction() {
-        dismiss(animated: true) {
-            let ac = UIAlertController(title: nil,
-                                       message: "Are you sure to delete".localized(), preferredStyle: .alert)
-            ac.addAction(UIAlertAction(title: "Cancel".localized(), style: .cancel))
-            ac.addAction(UIAlertAction(title: "Delete".localized(), style: .destructive, handler: { _ in
-                if let mVideo = self.operteItem, let mVideoId = mVideo.videoId {
-                    TSVideoOperator.shared.dataManager.deleteVideo(video: mVideo) { success in
-                        if success {
-                            /// 如果删除视频为当前播放视频,那么要清理当前播放
-                            if mVideo.videoId == PlayerManager.shared.currentVideo?.videoId {
-                                TSVideoOperator.shared.playerViewModel.clearCurrenVideo()
-                            }
-                        }
-                        NotificationCenter.default.post(name: .K_RefreshNotifaction, object: nil)
-                    }
-                }
-                self.dismissCurrentVc()
-            }))
-
-            PlayerManager.shared.rootVc?.present(ac, animated: true)
-        }
-    }
-
-    static func renamePlaylist(playlist: TSPlayList, completion: ((String) -> Void)? = nil) {
-        let alertVC = UIAlertController(title: nil, message: "Playlist Name".localized(), preferredStyle: .alert)
-        alertVC.addTextField { textField in
-            textField.placeholder = "input name".localized()
-            textField.font = UIFont.systemFont(ofSize: 16)
-            textField.text = playlist.title ?? ""
-        }
-        let ok = UIAlertAction(title: "OK".localized(), style: .default) { _ in
-            if let name = alertVC.textFields?.first?.text, !name.isEmpty {
-                TSVideoOperator.shared.dataManager.editPlaylistName(playList: playlist, name: name) { _ in
-                    THUD.toast("Renamed Successfully".localized())
-                    NotificationCenter.default.post(name: .K_RefreshNotifaction, object: nil)
-                    completion?(name)
-                }
-            }
-        }
-        let cancel = UIAlertAction(title: "Cancel".localized(), style: .cancel)
-        alertVC.addAction(cancel)
-        alertVC.addAction(ok)
-        PlayerManager.shared.rootVc?.present(alertVC, animated: true)
-    }
-
-    static func deletePlaylist(playlist: TSPlayList, completion: (() -> Void)? = nil) {
-        let ac = UIAlertController(title: nil,
-                                   message: "Are you sure to delete".localized(), preferredStyle: .alert)
-        ac.addAction(UIAlertAction(title: "Cancel".localized(), style: .cancel))
-        ac.addAction(UIAlertAction(title: "Delete".localized(), style: .destructive, handler: { _ in
-
-            TSVideoOperator.shared.dataManager.deletePlaylist(playlist: playlist) { _ in
-                NotificationCenter.default.post(name: .K_RefreshNotifaction, object: nil)
-                THUD.toast("Delete Successfully".localized())
-                completion?()
-            }
-
-        }))
-        PlayerManager.shared.rootVc?.present(ac, animated: true)
-    }
-}

+ 0 - 123
TSLiveWallpaper/Business/TSMusic/Helper/CWOperateViewController.swift

@@ -1,123 +0,0 @@
-//
-//  CWOperateViewController.swift
-//  ColorfulWallpaper
-//
-//  Created by ni on 2024/9/19.
-//
-
-import Foundation
-import TSVideoKit
-
-enum CWOperateType {
-    case like
-    case addPlaylist
-    case share
-    case deleteVideo
-    case rename
-    case deletePlaylist
-    case removeFromPlaylist
-}
-
-class CWOperateViewController: LWBaseViewController {
-    var operteItem: TSVideo?
-    var playlist: TSPlayList?
-
-    var disAppearArea: UIControl = .init()
-    lazy var songlistCell: OperateTopView = OperateTopView()
-    lazy var bgView: UIView = .simpleView(color: .hexColor("#222222"))
-    lazy var vStack: UIStackView = .vStack
-    lazy var likeItem: CWOperateItemView = .init(imgName: "ic_like_n", title: "Add to like".localized(), type: .like)
-    lazy var addPlaylistItem: CWOperateItemView = .init(imgName: "ic_add_playlist", title: "Add to Playlist".localized(), type: .addPlaylist)
-    lazy var removeFromPlaylist: CWOperateItemView = .init(imgName: "ic_remove_playlist", title: "Remove from playlist".localized(), type: .removeFromPlaylist)
-    lazy var shareItem: CWOperateItemView = .init(imgName: "ic_share", title: "Share".localized(), type: .share)
-    lazy var deleteItem: CWOperateItemView = .init(imgName: "ic_delete", title: "Delete".localized(), type: .deleteVideo)
-
-    var types: [CWOperateType] = [.like, .addPlaylist, .share, .deleteVideo]
-
-    lazy var cancelButton: UIButton = {
-        let btn = UIButton()
-        btn.setTitle("Cancel".localized(), for: .normal)
-        btn.setTitleColor(.white, for: .normal)
-        btn.titleLabel?.font = .systemFont14
-        btn.addTarget(self, action: #selector(dismissCurrentVc), for: .touchUpInside)
-        return btn
-    }()
-
-    @objc func dismissCurrentVc() {
-        dismiss(animated: true)
-    }
-
-    init(types: [CWOperateType] = [.like, .addPlaylist, .share, .deleteVideo]) {
-        super.init(nibName: nil, bundle: nil)
-        self.types = types
-    }
-
-    required init?(coder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-
-    override func viewDidLoad() {
-        if let model = operteItem {
-            songlistCell.bindData(video: model)
-        }
-        super.viewDidLoad()
-        addTargets()
-        updateLikeInfo(item: likeItem)
-    }
-
-    override func addChildren() {
-        super.addChildren()
-        view.backgroundColor = .black.withAlphaComponent(0.4)
-        view.addSubview(disAppearArea)
-        bgView.layer.cornerRadius = 16
-        bgView.layer.masksToBounds = true
-        view.addSubview(bgView)
-        bgView.addSubview(songlistCell)
-        bgView.addSubview(vStack)
-        vStack.addArrangedSubview(likeItem)
-        vStack.addArrangedSubview(addPlaylistItem)
-        vStack.addArrangedSubview(removeFromPlaylist)
-        vStack.addArrangedSubview(shareItem)
-        vStack.addArrangedSubview(deleteItem)
-        vStack.addArrangedSubview(cancelButton)
-        vStack.arrangedSubviews.forEach {
-            if let item = $0 as? CWOperateItemView, types.contains(item.type) {
-                $0.isHidden = false
-            } else {
-                $0.isHidden = true
-            }
-        }
-    }
-
-    override func makeConstarints() {
-        super.makeConstarints()
-        disAppearArea.snp.makeConstraints { make in
-            make.leading.trailing.top.equalToSuperview()
-            make.bottom.equalTo(bgView.snp.top)
-        }
-        bgView.snp.makeConstraints { make in
-            make.bottom.leading.trailing.equalToSuperview()
-        }
-
-        songlistCell.snp.makeConstraints { make in
-            make.height.equalTo(64)
-            make.top.leading.trailing.equalToSuperview()
-        }
-
-        vStack.snp.makeConstraints { make in
-            make.top.equalTo(songlistCell.snp.bottom)
-            make.leading.trailing.equalToSuperview()
-            make.bottom.equalTo(view.safeAreaLayoutGuide.snp.bottom)
-        }
-        cancelButton.snp.makeConstraints { make in
-            make.height.equalTo(44)
-        }
-    }
-
-    func updateLikeInfo(item: CWOperateItemView) {
-        let favIcon = operteItem?.isFavorite == true ? UIImage(
-            named: "ic_like_s") : UIImage(named: "ic_like")
-        item.iconView.image = favIcon
-        item.titleLabel.text = operteItem?.isFavorite == true ? "Remove from like".localized() : "Add to like".localized()
-    }
-}

+ 0 - 550
TSLiveWallpaper/Business/TSMusic/Helper/CWProgressView.swift

@@ -1,550 +0,0 @@
-import Foundation
-import UIKit
-
-@objc public enum CWCircularProgressGlowMode: Int {
-    case forward, reverse, constant, noGlow
-}
-
-@IBDesignable
-@objcMembers
-public class CWProgressView: UIView, CAAnimationDelegate {
-    private var progressLayer: KDCircularProgressViewLayer {
-        get {
-            return layer as! KDCircularProgressViewLayer
-        }
-    }
-    
-    private var radius: CGFloat = 0.0 {
-        didSet {
-            progressLayer.radius = radius
-        }
-    }
-    
-    public var progress: Double {
-        get { return angle.mod(between: 0.0, and: 360.0, byIncrementing: 360.0) / 360.0 }
-        set { angle = newValue.clamp(lowerBound: 0.0, upperBound: 1.0) * 360.0 }
-    }
-    
-    @IBInspectable public var angle: Double = 0.0 {
-        didSet {
-            pauseIfAnimating()
-            progressLayer.angle = angle
-        }
-    }
-    
-    @IBInspectable public var startAngle: Double = 0.0 {
-        didSet {
-            startAngle = startAngle.mod(between: 0.0, and: 360.0, byIncrementing: 360.0)
-            progressLayer.startAngle = startAngle
-            progressLayer.setNeedsDisplay()
-        }
-    }
-    
-    @IBInspectable public var clockwise: Bool = true {
-        didSet {
-            progressLayer.clockwise = clockwise
-            progressLayer.setNeedsDisplay()
-        }
-    }
-    
-    @IBInspectable public var roundedCorners: Bool = true {
-        didSet {
-            progressLayer.roundedCorners = roundedCorners
-        }
-    }
-    
-    @IBInspectable public var lerpColorMode: Bool = false {
-        didSet {
-            progressLayer.lerpColorMode = lerpColorMode
-        }
-    }
-    
-    @IBInspectable public var gradientRotateSpeed: CGFloat = 0.0 {
-        didSet {
-            progressLayer.gradientRotateSpeed = gradientRotateSpeed
-        }
-    }
-    
-    @IBInspectable public var glowAmount: CGFloat = 1.0 {
-        didSet {
-            glowAmount = glowAmount.clamp(lowerBound: 0.0, upperBound: 1.0)
-            progressLayer.glowAmount = glowAmount
-        }
-    }
-    
-    public var glowMode: CWCircularProgressGlowMode = .forward {
-        didSet {
-            progressLayer.glowMode = glowMode
-        }
-    }
-    
-    @IBInspectable public var progressThickness: CGFloat = 0.4 {
-        didSet {
-            progressThickness = progressThickness.clamp(lowerBound: 0.0, upperBound: 1.0)
-            progressLayer.progressThickness = progressThickness / 2.0
-        }
-    }
-    
-    @IBInspectable public var trackThickness: CGFloat = 0.5 {//Between 0 and 1
-        didSet {
-            trackThickness = trackThickness.clamp(lowerBound: 0.0, upperBound: 1.0)
-            progressLayer.trackThickness = trackThickness / 2.0
-        }
-    }
-    
-    @IBInspectable public var trackColor: UIColor = .black {
-        didSet {
-            progressLayer.trackColor = trackColor
-            progressLayer.setNeedsDisplay()
-        }
-    }
-    
-    @IBInspectable public var progressInsideFillColor: UIColor? = nil {
-        didSet {
-            progressLayer.progressInsideFillColor = progressInsideFillColor ?? .clear
-        }
-    }
-    
-    public var progressColors: [UIColor] {
-        get { return progressLayer.colorsArray }
-        set { set(colors: newValue) }
-    }
-    
-    //These are used only from the Interface-Builder. Changing these from code will have no effect.
-    //Also IB colors are limited to 3, whereas programatically we can have an arbitrary number of them.
-    @objc @IBInspectable private var IBColor1: UIColor?
-    @objc @IBInspectable private var IBColor2: UIColor?
-    @objc @IBInspectable private var IBColor3: UIColor?
-    
-    private var animationCompletionBlock: ((Bool) -> Void)?
-    
-    override public init(frame: CGRect) {
-        super.init(frame: frame)
-        setInitialValues()
-        refreshValues()
-    }
-    
-    convenience public init(frame:CGRect, colors: UIColor...) {
-        self.init(frame: frame)
-        set(colors: colors)
-    }
-    
-    required public init?(coder aDecoder: NSCoder) {
-        super.init(coder: aDecoder)
-        translatesAutoresizingMaskIntoConstraints = false
-        setInitialValues()
-        refreshValues()
-    }
-    
-    public override func awakeFromNib() {
-        checkAndSetIBColors()
-    }
-    
-    override public class var layerClass: AnyClass {
-        return KDCircularProgressViewLayer.self
-    }
-    
-    public override func layoutSubviews() {
-        super.layoutSubviews()
-        radius = (frame.size.width / 2.0) * 0.8
-    }
-    
-    private func setInitialValues() {
-        radius = (frame.size.width / 2.0) * 0.8 //We always apply a 20% padding, stopping glows from being clipped
-        backgroundColor = .clear
-        set(colors: .white, .cyan)
-    }
-    
-    private func refreshValues() {
-        progressLayer.angle = angle
-        progressLayer.startAngle = startAngle
-        progressLayer.clockwise = clockwise
-        progressLayer.roundedCorners = roundedCorners
-        progressLayer.lerpColorMode = lerpColorMode
-        progressLayer.gradientRotateSpeed = gradientRotateSpeed
-        progressLayer.glowAmount = glowAmount
-        progressLayer.glowMode = glowMode
-        progressLayer.progressThickness = progressThickness / 2.0
-        progressLayer.trackColor = trackColor
-        progressLayer.trackThickness = trackThickness / 2.0
-    }
-    
-    private func checkAndSetIBColors() {
-        let IBColors = [IBColor1, IBColor2, IBColor3].compactMap { $0 }
-        if IBColors.isEmpty == false {
-            set(colors: IBColors)
-        }
-    }
-    
-    public func set(colors: UIColor...) {
-        set(colors: colors)
-    }
-    
-    private func set(colors: [UIColor]) {
-        progressLayer.colorsArray = colors
-        progressLayer.setNeedsDisplay()
-    }
-    
-    public func animate(fromAngle: Double, toAngle: Double, duration: TimeInterval, relativeDuration: Bool = true, completion: ((Bool) -> Void)?) {
-        pauseIfAnimating()
-        let animationDuration: TimeInterval
-        if relativeDuration {
-            animationDuration = duration
-        } else {
-            let traveledAngle = (toAngle - fromAngle).mod(between: 0.0, and: 360.0, byIncrementing: 360.0)
-            let scaledDuration = TimeInterval(traveledAngle) * duration / 360.0
-            animationDuration = scaledDuration
-        }
-        
-        let animation = CABasicAnimation(keyPath: #keyPath(KDCircularProgressViewLayer.angle))
-        animation.fromValue = fromAngle
-        animation.toValue = toAngle
-        animation.duration = animationDuration
-        animation.delegate = self
-        animation.isRemovedOnCompletion = false
-        angle = toAngle
-        animationCompletionBlock = completion
-        
-        progressLayer.add(animation, forKey: "angle")
-    }
-    
-    public func animate(toAngle: Double, duration: TimeInterval, relativeDuration: Bool = true, completion: ((Bool) -> Void)?) {
-        pauseIfAnimating()
-        animate(fromAngle: angle, toAngle: toAngle, duration: duration, relativeDuration: relativeDuration, completion: completion)
-    }
-    
-    public func pauseAnimation() {
-        guard let presentationLayer = progressLayer.presentation() else { return }
-        
-        let currentValue = presentationLayer.angle
-        progressLayer.removeAllAnimations()
-        angle = currentValue
-    }
-    
-    private func pauseIfAnimating() {
-        if isAnimating() {
-            pauseAnimation()
-        }
-    }
-    
-    public func stopAnimation() {
-        progressLayer.removeAllAnimations()
-        angle = 0
-    }
-    
-    public func isAnimating() -> Bool {
-        return progressLayer.animation(forKey: "angle") != nil
-    }
-    
-    public func animationDidStop(_ anim: CAAnimation, finished flag: Bool) {
-        animationCompletionBlock?(flag)
-        animationCompletionBlock = nil
-    }
-    
-    public override func didMoveToWindow() {
-        window.map { progressLayer.contentsScale = $0.screen.scale }
-    }
-    
-    public override func willMove(toSuperview newSuperview: UIView?) {
-        if newSuperview == nil {
-            pauseIfAnimating()
-        }
-    }
-    
-    public override func prepareForInterfaceBuilder() {
-        setInitialValues()
-        refreshValues()
-        checkAndSetIBColors()
-        progressLayer.setNeedsDisplay()
-    }
-    
-    private class KDCircularProgressViewLayer: CALayer {
-        @NSManaged var angle: Double
-        var radius: CGFloat = 0.0 {
-            didSet { invalidateGradientCache() }
-        }
-        var startAngle: Double = 0.0
-        var clockwise: Bool = true {
-            didSet {
-                if clockwise != oldValue {
-                    invalidateGradientCache()
-                }
-            }
-        }
-        var roundedCorners: Bool = true
-        var lerpColorMode: Bool = false
-        var gradientRotateSpeed: CGFloat = 0.0 {
-            didSet { invalidateGradientCache() }
-        }
-        var glowAmount: CGFloat = 0.0
-        var glowMode: CWCircularProgressGlowMode = .forward
-        var progressThickness: CGFloat = 0.5
-        var trackThickness: CGFloat = 0.5
-        var trackColor: UIColor = .black
-        var progressInsideFillColor: UIColor = .clear
-        var colorsArray: [UIColor] = [] {
-            didSet { invalidateGradientCache() }
-        }
-        private var gradientCache: CGGradient?
-        private var locationsCache: [CGFloat]?
-        
-        private enum GlowConstants {
-            private static let sizeToGlowRatio: CGFloat = 0.00015
-            static func glowAmount(forAngle angle: Double, glowAmount: CGFloat, glowMode: CWCircularProgressGlowMode, size: CGFloat) -> CGFloat {
-                switch glowMode {
-                case .forward:
-                    return CGFloat(angle) * size * sizeToGlowRatio * glowAmount
-                case .reverse:
-                    return CGFloat(360.0 - angle) * size * sizeToGlowRatio * glowAmount
-                case .constant:
-                    return 360.0 * size * sizeToGlowRatio * glowAmount
-                default:
-                    return 0
-                }
-            }
-        }
-        
-        override class func needsDisplay(forKey key: String) -> Bool {
-            if key == #keyPath(angle) {
-                return true
-            }
-            return super.needsDisplay(forKey: key)
-        }
-        
-        override init(layer: Any) {
-            super.init(layer: layer)
-            let progressLayer = layer as! KDCircularProgressViewLayer
-            radius = progressLayer.radius
-            angle = progressLayer.angle
-            startAngle = progressLayer.startAngle
-            clockwise = progressLayer.clockwise
-            roundedCorners = progressLayer.roundedCorners
-            lerpColorMode = progressLayer.lerpColorMode
-            gradientRotateSpeed = progressLayer.gradientRotateSpeed
-            glowAmount = progressLayer.glowAmount
-            glowMode = progressLayer.glowMode
-            progressThickness = progressLayer.progressThickness
-            trackThickness = progressLayer.trackThickness
-            trackColor = progressLayer.trackColor
-            colorsArray = progressLayer.colorsArray
-            progressInsideFillColor = progressLayer.progressInsideFillColor
-        }
-        
-        override init() {
-            super.init()
-        }
-        
-        required init?(coder aDecoder: NSCoder) {
-            super.init(coder: aDecoder)
-        }
-        
-        override func draw(in ctx: CGContext) {
-            UIGraphicsPushContext(ctx)
-            
-            let size = bounds.size
-            let width = size.width
-            let height = size.height
-            
-            let trackLineWidth = radius * trackThickness
-            let progressLineWidth = radius * progressThickness
-            let arcRadius = max(radius - trackLineWidth / 2.0, radius - progressLineWidth / 2.0)
-            ctx.addArc(center: CGPoint(x: width / 2.0, y: height / 2.0),
-                       radius: arcRadius,
-                       startAngle: 0,
-                       endAngle: CGFloat.pi * 2,
-                       clockwise: false)
-            ctx.setStrokeColor(trackColor.cgColor)
-            ctx.setFillColor(progressInsideFillColor.cgColor)
-            ctx.setLineWidth(trackLineWidth)
-            ctx.setLineCap(CGLineCap.butt)
-            ctx.drawPath(using: .fillStroke)
-            
-            UIGraphicsBeginImageContextWithOptions(size, false, 0.0)
-            
-            let imageCtx = UIGraphicsGetCurrentContext()
-            let canonicalAngle = angle.mod(between: 0.0, and: 360.0, byIncrementing: 360.0)
-            let fromAngle = -startAngle.radians
-            let toAngle: Double
-            if clockwise {
-                toAngle = (-canonicalAngle - startAngle).radians
-            } else {
-                toAngle = (canonicalAngle - startAngle).radians
-            }
-            
-            imageCtx?.addArc(center: CGPoint(x: width / 2.0, y: height / 2.0),
-                             radius: arcRadius,
-                             startAngle: CGFloat(fromAngle),
-                             endAngle: CGFloat(toAngle),
-                             clockwise: clockwise)
-            
-            let glowValue = GlowConstants.glowAmount(forAngle: canonicalAngle, glowAmount: glowAmount, glowMode: glowMode, size: width)
-            if glowValue > 0 {
-                imageCtx?.setShadow(offset: .zero, blur: glowValue, color: UIColor.black.cgColor)
-            }
-            
-            let linecap: CGLineCap = roundedCorners ? .round : .butt
-            imageCtx?.setLineCap(linecap)
-            imageCtx?.setLineWidth(progressLineWidth)
-            imageCtx?.drawPath(using: .stroke)
-            
-            let drawMask: CGImage = UIGraphicsGetCurrentContext()!.makeImage()!
-            UIGraphicsEndImageContext()
-            
-            ctx.saveGState()
-            ctx.clip(to: bounds, mask: drawMask)
-            
-            if colorsArray.isEmpty {
-                fillRect(withContext: ctx, color: .white)
-            } else if colorsArray.count == 1 {
-                fillRect(withContext: ctx, color: colorsArray[0])
-            } else if lerpColorMode {
-                lerp(withContext: ctx, colorsArray: colorsArray)
-            } else {
-                drawGradient(withContext: ctx, colorsArray: colorsArray)
-            }
-
-            ctx.restoreGState()
-            UIGraphicsPopContext()
-        }
-        
-        private func lerp(withContext context: CGContext, colorsArray: [UIColor]) {
-            let canonicalAngle = angle.mod(between: 0.0, and: 360.0, byIncrementing: 360.0)
-            let percentage = canonicalAngle / 360.0
-            let steps = colorsArray.count - 1
-            let step = 1.0 / Double(steps)
-            
-            for i in 1...steps {
-                let di = Double(i)
-                if percentage <= di * step || i == steps {
-                    let colorT = percentage.inverseLerp(min: (di - 1) * step, max: di * step)
-                    let color = colorT.colorLerp(minColor: colorsArray[i - 1], maxColor: colorsArray[i])
-                    fillRect(withContext: context, color: color)
-                    break
-                }
-            }
-        }
-        
-        private func fillRect(withContext context: CGContext, color: UIColor) {
-            context.setFillColor(color.cgColor)
-            context.fill(bounds)
-        }
-        
-        private func drawGradient(withContext context: CGContext, colorsArray: [UIColor]) {
-            let baseSpace = CGColorSpaceCreateDeviceRGB()
-            let locations = locationsCache ?? gradientLocationsFor(colorCount: colorsArray.count, gradientWidth: bounds.size.width)
-            let gradient: CGGradient
-            
-            if let cachedGradient = gradientCache {
-                gradient = cachedGradient
-            } else {
-                guard let newGradient = CGGradient(colorSpace: baseSpace, colorComponents: colorsArray.rgbNormalized.componentsJoined,
-                                                   locations: locations, count: colorsArray.count) else { return }
-                
-                gradientCache = newGradient
-                gradient = newGradient
-            }
-            
-            let halfX = bounds.size.width / 2.0
-            let floatPi = CGFloat.pi
-            let rotateSpeed = clockwise == true ? gradientRotateSpeed : gradientRotateSpeed * -1.0
-            let angleInRadians = (rotateSpeed * CGFloat(angle) - 90.0).radians
-            let oppositeAngle = angleInRadians > floatPi ? angleInRadians - floatPi : angleInRadians + floatPi
-            
-            let startPoint = CGPoint(x: (cos(angleInRadians) * halfX) + halfX, y: (sin(angleInRadians) * halfX) + halfX)
-            let endPoint = CGPoint(x: (cos(oppositeAngle) * halfX) + halfX, y: (sin(oppositeAngle) * halfX) + halfX)
-            
-            context.drawLinearGradient(gradient, start: startPoint, end: endPoint, options: .drawsBeforeStartLocation)
-        }
-        
-        private func gradientLocationsFor(colorCount: Int, gradientWidth: CGFloat) -> [CGFloat] {
-            guard colorCount > 0, gradientWidth > 0 else { return [] }
-
-            let progressLineWidth = radius * progressThickness
-            let firstPoint = gradientWidth / 2.0 - (radius - progressLineWidth / 2.0)
-            let increment = (gradientWidth - (2.0 * firstPoint)) / CGFloat(colorCount - 1)
-            
-            let locationsArray = (0..<colorCount).map { firstPoint + (CGFloat($0) * increment) }
-            let result = locationsArray.map { $0 / gradientWidth }
-            locationsCache = result
-            return result
-        }
-        
-        private func invalidateGradientCache() {
-            gradientCache = nil
-            locationsCache = nil
-        }
-    }
-}
-
-//Some helper extensions below
-
-private extension Array where Element == UIColor {
-    // Make sure every color in colors array is in RGB color space
-    var rgbNormalized: [UIColor] {
-        return map { color in
-            guard color.cgColor.numberOfComponents == 2 else {
-                return color
-            }
-            
-            let white: CGFloat = color.cgColor.components![0]
-            return UIColor(red: white, green: white, blue: white, alpha: 1.0)
-        }
-    }
-    
-    var componentsJoined: [CGFloat] {
-        return flatMap { $0.cgColor.components ?? [] }
-    }
-}
-
-private extension Comparable {
-    func clamp(lowerBound: Self, upperBound: Self) -> Self {
-        return min(max(self, lowerBound), upperBound)
-    }
-}
-
-private extension FloatingPoint {
-    var radians: Self {
-        return self * .pi / Self(180)
-    }
-    
-    func mod(between left: Self, and right: Self, byIncrementing interval: Self) -> Self {
-        assert(interval > 0)
-        assert(interval <= right - left)
-        assert(right > left)
-        
-        if self >= left, self <= right {
-            return self
-        } else if self < left {
-            return (self + interval).mod(between: left, and: right, byIncrementing: interval)
-        } else {
-            return (self - interval).mod(between: left, and: right, byIncrementing: interval)
-        }
-    }
-}
-
-private extension BinaryFloatingPoint {
-    func inverseLerp(min: Self, max: Self) -> Self {
-        return (self - min) / (max - min)
-    }
-    
-    func lerp(min: Self, max: Self) -> Self {
-        return (max - min) * self + min
-    }
-    
-    func colorLerp(minColor: UIColor, maxColor: UIColor) -> UIColor {
-        let clampedValue = CGFloat(self.clamp(lowerBound: 0.0, upperBound: 1.0))
-        let zero = CGFloat(0.0)
-        
-        
-        var (r0, g0, b0, a0) = (zero, zero, zero, zero)
-        minColor.getRed(&r0, green: &g0, blue: &b0, alpha: &a0)
-        
-        var (r1, g1, b1, a1) = (zero, zero, zero, zero)
-        maxColor.getRed(&r1, green: &g1, blue: &b1, alpha: &a1)
-        
-        return UIColor(red: clampedValue.lerp(min: r0, max: r1),
-                       green: clampedValue.lerp(min: g0, max: g1),
-                       blue: clampedValue.lerp(min: b0, max: b1),
-                       alpha: clampedValue.lerp(min: a0, max: a1))
-    }
-}

+ 0 - 174
TSLiveWallpaper/Business/TSMusic/Helper/FilterBarView.swift

@@ -1,174 +0,0 @@
-//
-//  FilterBarView.swift
-//  ColorfulWallpaper
-//
-//  Created by nkl on 2024/9/10.
-//
-
-import Foundation
-import UIKit
-class FilterBarView: UIView {
-    /// default layout items
-    lazy var playIcon: UIImageView = UIImageView(image: UIImage(named: "ic_playall"))
-
-    lazy var playButton: UIButton = {
-        let btn = UIButton()
-        btn.setTitle("Play All (0)", for: .normal)
-        btn.titleLabel?.font = .systemFont(ofSize: 14)
-        return btn
-    }()
-
-    lazy var mutiButton: UIButton = {
-        let btn = UIButton()
-        btn.setImage(UIImage(named: "ic_mine_ring_muti"), for: .normal)
-        return btn
-    }()
-
-    lazy var sortButton: UIButton = {
-        let btn = UIButton()
-        btn.setImage(UIImage(named: "ic_mine_ring_sort_down"), for: .normal)
-        return btn
-    }()
-
-    lazy var selectButton: SpacedButton = {
-        let btn = SpacedButton()
-        btn.setImage(UIImage(named: "ic_check_n"), for: .normal)
-        btn.setImage(UIImage(named: "ic_check_s"), for: .selected)
-        btn.setTitle("Select All (0/0)", for: .normal)
-        btn.titleLabel?.font = .systemFont(ofSize: 14)
-        btn.isHidden = true
-        btn.spacing = 8
-        if FitManager.isAr {
-            btn.semanticContentAttribute = .forceLeftToRight
-        }
-        return btn
-    }()
-
-    lazy var searchButton: UIButton = {
-        let btn = UIButton()
-        btn.setImage(UIImage(named: "local_search"), for: .normal)
-        return btn
-    }()
-
-    lazy var finishMutiButton: UIButton = {
-        let btn = UIButton()
-        btn.setTitle("Done".localized(), for: .normal)
-        btn.titleLabel?.font = .systemFont(ofSize: 14)
-        btn.setTitleColor(.hexColor("#60FFD2"), for: .normal)
-        btn.isHidden = true
-        return btn
-    }()
-
-    lazy var hStack: UIStackView = .hStack
-
-    var type: MineRingTopType = .default {
-        didSet {
-            if type == .default {
-                defaultlayout()
-            } else {
-                mutiSelectlayout()
-            }
-        }
-    }
-
-    func defaultlayout() {
-        playIcon.isHidden = false
-        playButton.isHidden = false
-        mutiButton.isHidden = true
-        sortButton.isHidden = true
-        searchButton.isHidden = true
-
-        selectButton.isHidden = true
-        finishMutiButton.isHidden = true
-        playButton.isHidden = false
-        mutiButton.isHidden = false
-        sortButton.isHidden = false
-        searchButton.isHidden = true
-
-        selectButton.isHidden = true
-        finishMutiButton.isHidden = true
-    }
-
-    func mutiSelectlayout() {
-        playIcon.isHidden = false
-        playButton.isHidden = false
-        playButton.isHidden = true
-        mutiButton.isHidden = true
-        sortButton.isHidden = true
-        searchButton.isHidden = true
-
-        selectButton.isHidden = true
-        finishMutiButton.isHidden = true
-        playIcon.isHidden = true
-        playButton.isHidden = true
-        mutiButton.isHidden = true
-        sortButton.isHidden = true
-        searchButton.isHidden = true
-
-        selectButton.isHidden = false
-        finishMutiButton.isHidden = false
-    }
-
-    override init(frame: CGRect) {
-        super.init(frame: frame)
-        addChildren()
-        makeConstraint()
-    }
-
-    func addChildren() {
-        playIcon.isUserInteractionEnabled = true
-        addSubview(playIcon)
-        addSubview(playButton)
-        addSubview(selectButton)
-
-        addSubview(hStack)
-        hStack.addArrangedSubview(sortButton)
-        hStack.addArrangedSubview(mutiButton)
-        hStack.addArrangedSubview(finishMutiButton)
-//        hStack.addArrangedSubview(searchButton)
-    }
-
-    func makeConstraint() {
-        playIcon.snp.makeConstraints { make in
-            make.leading.equalToSuperview()
-            make.centerY.equalToSuperview()
-        }
-
-        playButton.snp.makeConstraints { make in
-            make.leading.equalTo(playIcon.snp.trailing).offset(8)
-            make.centerY.equalTo(playIcon)
-            make.height.equalToSuperview()
-        }
-
-        hStack.snp.makeConstraints { make in
-            make.trailing.equalToSuperview()
-            make.centerY.equalToSuperview()
-        }
-
-        selectButton.snp.makeConstraints { make in
-            make.leading.equalToSuperview()
-            make.centerY.equalToSuperview()
-        }
-        selectButton.sizeToFit()
-
-        searchButton.snp.makeConstraints { make in
-            make.width.height.equalTo(34)
-        }
-
-        finishMutiButton.snp.makeConstraints { make in
-            make.height.equalTo(34)
-        }
-
-        mutiButton.snp.makeConstraints { make in
-            make.width.height.equalTo(34)
-        }
-
-        sortButton.snp.makeConstraints { make in
-            make.width.height.equalTo(34)
-        }
-    }
-
-    required init?(coder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-}

+ 0 - 147
TSLiveWallpaper/Business/TSMusic/Helper/FilterBarViewController.swift

@@ -1,147 +0,0 @@
-//
-//  FilterBarViewController.swift
-//  ColorfulWallpaper
-//
-//  Created by nkl on 2024/9/10.
-//
-
-import Combine
-import Foundation
-import TSVideoKit
-
-protocol FilterBarViewControllerDelegate: AnyObject {
-    /// 全选video回调
-    /// - Parameter videos: selectedVideos
-    func selectedAllVideo()
-    
-    /// 完成管理
-    /// - Parameter videos: selectedVideos
-    func doneMutiManage()
-
-    /// 是否进入多选状态
-    /// - Parameter barType: 视图type切换回调
-    func topBarTypeDidChange(barType: MineRingTopType)
-
-    /// 排序规则改变回调
-    /// - Parameter sortType: 排序类型
-    func sortTypeDidChange(sortType: SortType)
-
-    /// 本地搜索回调
-    /// - Parameter
-    func localSearchDidClicked()
-}
-
-class FilterBarViewController: UIViewController {
-    lazy var topHeader: FilterBarView = FilterBarView()
-    var viewModel: FilterBarViewModel?
-    weak var delegate: FilterBarViewControllerDelegate?
-    var needSearch: Bool = true
-
-    private var cancellables: [AnyCancellable] = []
-
-    convenience init(viewModel: FilterBarViewModel) {
-        self.init()
-        self.viewModel = viewModel
-    }
-
-    override func viewDidLoad() {
-        super.viewDidLoad()
-        addChildren()
-        makeConstraints()
-        addNotifaction()
-    }
-
-    func addNotifaction() {
-        viewModel?.$selectedVideos.receive(on: DispatchQueue.main).sink { videos in
-            PlayerManager.shared.selectedVideos = videos
-            PlayerManager.shared.removePlaylist = self.viewModel?.playlist
-            self.updateBarInfo()
-        }.store(in: &cancellables)
-
-        viewModel?.$barType.receive(on: DispatchQueue.main).sink { type in
-            self.updateBarInfo()
-            self.topHeader.type = type
-            if type == .mutiselect {
-                self.topHeader.searchButton.isHidden = true
-            } else {
-                self.topHeader.searchButton.isHidden = !self.needSearch
-            }
-
-            self.delegate?.topBarTypeDidChange(barType: type)
-        }.store(in: &cancellables)
-
-        viewModel?.$sortType.receive(on: DispatchQueue.main).sink { sortType in
-            self.updateBarInfo()
-            self.delegate?.sortTypeDidChange(sortType: sortType)
-        }.store(in: &cancellables)
-    }
-
-    func updateBarInfo() {
-        guard let viewModel = viewModel else { return }
-        topHeader.playButton.setTitle(viewModel.playTitle, for: .normal)
-        topHeader.selectButton.setTitle(viewModel.selectTitle, for: .normal)
-        topHeader.selectButton.isSelected = viewModel.selectedVideos.count == viewModel.videos.count
-        if viewModel.sortType == .downName || viewModel.sortType == .downTime {
-            topHeader.sortButton.setImage(UIImage(named: "ic_mine_ring_sort_down"), for: .normal)
-        } else {
-            topHeader.sortButton.setImage(UIImage(named: "ic_mine_ring_sort_up"), for: .normal)
-        }
-    }
-
-    func addChildren() {
-        view.addSubview(topHeader)
-        addTargets()
-    }
-
-    func addTargets() {
-        let gesture = UITapGestureRecognizer(target: self, action: #selector(playAllMusic))
-        topHeader.playIcon.addGestureRecognizer(gesture)
-        topHeader.playButton.addTarget(self, action: #selector(playAllMusic), for: .touchUpInside)
-        topHeader.mutiButton.addTarget(self, action: #selector(mutiButtonClickEvent), for: .touchUpInside)
-        topHeader.finishMutiButton.addTarget(self, action: #selector(mutiDoneButtonClicked), for: .touchUpInside)
-        topHeader.selectButton.addTarget(self, action: #selector(selectAllVideos(sender:)), for: .touchUpInside)
-        topHeader.sortButton.addTarget(self, action: #selector(showSortAlertController), for: .touchUpInside)
-        topHeader.searchButton.addTarget(self, action: #selector(goToLocalSearch), for: .touchUpInside)
-    }
-
-    func addToSelectedList(video: TSVideo) {
-        viewModel?.addToSelectedList(video: video)
-    }
-
-    func makeConstraints() {
-        topHeader.snp.makeConstraints { make in
-            make.edges.equalToSuperview()
-        }
-    }
-}
-
-extension FilterBarViewController {
-    @objc func showSortAlertController() {
-        viewModel?.showSortOperateView(parent: self)
-    }
-
-    @objc func selectAllVideos(sender: UIButton) {
-        delegate?.selectedAllVideo()
-    }
-
-    @objc func mutiButtonClickEvent() {
-        guard let viewModel = viewModel else { return }
-        viewModel.beginMutiSelect()
-    }
-
-    @objc func mutiDoneButtonClicked() {
-        guard let viewModel = viewModel else { return }
-        topHeader.selectButton.isSelected = false
-        viewModel.doneMutiSelect()
-        self.delegate?.doneMutiManage()
-    }
-
-    @objc func playAllMusic() {
-        guard let viewModel = viewModel else { return }
-        viewModel.playAllVideos()
-    }
-
-    @objc func goToLocalSearch() {
-        delegate?.localSearchDidClicked()
-    }
-}

+ 0 - 82
TSLiveWallpaper/Business/TSMusic/Helper/FilterBarViewModel.swift

@@ -1,82 +0,0 @@
-//
-//  FilterBarViewModel.swift
-//  ColorfulWallpaper
-//
-//  Created by nkl on 2024/9/10.
-//
-
-import Foundation
-import TSVideoKit
-
-enum MineRingTopType {
-    case `default`
-    case mutiselect
-}
-
-class FilterBarViewModel {
-    @Published var videos: [TSVideo] = []
-    @Published var barType: MineRingTopType = .default
-    @Published var selectedVideos: [TSVideo] = []
-    @Published var sortType: SortType = .downTime
-    var playlist: TSPlayList?
-    var isFromPlaylist: Bool = false
-
-    init(videos: [TSVideo], barTyle: MineRingTopType, selectedVideos: [TSVideo], sortType: SortType) {
-        self.videos = videos
-        barType = barTyle
-        self.selectedVideos = selectedVideos
-        self.sortType = sortType
-    }
-
-    var selectTitle: String {
-        return "Select All".localized() + " (\(selectedVideos.count)/\(videos.count)) "
-    }
-
-    var playTitle: String {
-        return "Play All".localized() + " (\(videos.count)) "
-    }
-
-    func showSortOperateView(parent: UIViewController) {
-        let vc = SortMenuViewController(type: sortType)
-        vc.modalPresentationStyle = .overFullScreen
-        vc.didSelectedSortType = { type in
-            self.sortType = type
-        }
-        parent.present(vc, animated: true)
-    }
-
-    /// 播放全部按钮
-    func playAllVideos() {
-        if let firstVideo = videos.first {
-            PlayerManager.shared.player?.playControl.viewModel.loopMode = .cyclic
-            PlayerManager.shared.playVideo(video: firstVideo, list: videos, scene: .local, onceAdKey: "")
-        }
-    }
-
-    /// 多选按钮点击
-    func beginMutiSelect() {
-        barType = .mutiselect
-        PlayerManager.shared.showMutiOperateView(isFromPlaylist: isFromPlaylist, playlist: playlist)
-    }
-
-    /// 多选取消
-    func doneMutiSelect() {
-        barType = .default
-        PlayerManager.shared.hideMutiOperateView()
-    }
-
-    /// 加入选中列表
-    /// - Parameter video: video
-    func addToSelectedList(video: TSVideo) {
-        // 已经有了,那么删除
-        if selectedVideos.contains(where: {
-            $0.videoId == video.videoId
-        }) {
-            selectedVideos.removeAll(where: {
-                $0.videoId == video.videoId
-            })
-        } else {
-            selectedVideos.append(video)
-        }
-    }
-}

+ 0 - 57
TSLiveWallpaper/Business/TSMusic/Helper/GuideBubbleView.swift

@@ -1,57 +0,0 @@
-//
-//  GuideBubbleView.swift
-//  PhysicalWallPaper
-//
-//  Created by nkl on 2024/12/17.
-//
-
-import Foundation
-import UIKit
-
-class GuideBubbleView: UIControl {
-    
-    lazy var titleLabel: UILabel = {
-        let lab = UILabel()
-        lab.textColor = .white
-        lab.font = .systemFont(ofSize: 16)
-        lab.text = "Find your favorite songs".localized()
-        return lab
-    }()
-    
-    lazy var bgView: UIImageView = .init(image: UIImage.init(named: "ic_bubble_bg"))
-    
-    lazy var tapArea : UIControl = UIControl()
-    
-    override init(frame: CGRect) {
-        super.init(frame: frame)
-        addChildren()
-        makeConstraints()
-    }
-    
-    func addChildren(){
-        addSubview(bgView)
-        bgView.addSubview(titleLabel)
-        addSubview(tapArea)
-    }
-    
-    func makeConstraints(){
-        bgView.snp.makeConstraints { make in
-            make.centerX.equalToSuperview()
-            make.top.equalTo(safeAreaLayoutGuide.snp.top).offset(84)
-        }
-        
-        titleLabel.snp.makeConstraints { make in
-            make.horizontalEdges.equalToSuperview().inset(12)
-            make.centerY.equalToSuperview()
-        }
-        
-        tapArea.snp.makeConstraints { make in
-            make.top.leading.trailing.equalToSuperview()
-            make.bottom.equalTo(bgView)
-        }
-    }
-    
-    required init?(coder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-}

+ 0 - 135
TSLiveWallpaper/Business/TSMusic/Helper/OperateTopView.swift

@@ -1,135 +0,0 @@
-//
-//  OperateTopView.swift
-//  TSLiveWallpaper
-//
-//  Created by nkl on 2024/12/23.
-//
-
-import Foundation
-import TSVideoKit
-import UIKit
-
-class OperateTopView: UIView {
-    lazy var hStack: UIStackView = {
-        let stack: UIStackView = .hStack
-        stack.spacing = 14
-        return stack
-    }()
-
-    lazy var raduiButton: UIButton = {
-        let btn = UIButton()
-        btn.setImage(UIImage(named: "ic_mine_ring_mutil_unselect"), for: .normal)
-        btn.setImage(UIImage(named: "ic_mine_ring_mutil_select"), for: .selected)
-        btn.isHidden = true
-        btn.isUserInteractionEnabled = false
-
-        return btn
-    }()
-
-    lazy var bgView: UIView = .simpleView(color: .clear)
-
-    lazy var bgImageView: UIImageView = .simpleImage(imageName: "ic_minibar_bg")
-    lazy var lineView: UIView = .simpleView(color: .white.withAlphaComponent(0.1))
-
-    lazy var iconView: UIImageView = {
-        let img: UIImageView = .init(image: UIImage(named: ""))
-        img.customCornerRadius = 8
-        img.contentMode = .scaleAspectFill
-        return img
-    }()
-
-    lazy var titleLabel: UILabel = .simpleLabel(text: "", color: .white)
-    lazy var timeLabel: UILabel = .simpleLabel(text: "UnKnown".localized(), color: .white.withAlphaComponent(0.4))
-    lazy var stackView: UIStackView = {
-        let stack: UIStackView = .vStack
-        stack.spacing = 8
-        return stack
-    }()
-
-    private var mVideo: TSVideo?
-    var mPlaylist: TSPlayList?
-
-    override init(frame: CGRect) {
-        super.init(frame: frame)
-        backgroundColor = .clear
-        addChildren()
-        makeConstraints()
-    }
-
-    func bindData(video: TSVideo, isMutiSelected: Bool = false, isSelected: Bool = false, needOperate: Bool = false) {
-        mVideo = video
-        let isPlaying = mVideo?.videoId == PlayerManager.shared.currentVideo?.videoId
-//        titleLabel.textColor = isPlaying ? .hexColor("#89FC42") : .white
-//        timeLabel.textColor = (isPlaying ? UIColor.hexColor("#89FC42") : .white).withAlphaComponent(0.4)
-        titleLabel.text = video.title
-        if let artist = video.artist {
-            timeLabel.text = artist.isEmpty == true ? "UnKnown".localized() : video.artist
-        } else {
-            timeLabel.text = "UnKnown".localized()
-        }
-
-        if video.isOnline {
-            iconView.kf.setImage(with: video.iconUrl, placeholder: UIImage(named: "ic_default"))
-        } else {
-            if let imgData = video.artwork {
-                iconView.image = UIImage(data: imgData)
-            } else {
-                iconView.image = UIImage(named: "ic_default")
-            }
-        }
-        if PlayerManager.shared.currentVideo?.videoId == video.videoId {
-            bgImageView.isHidden = false
-        } else {
-            bgImageView.isHidden = true
-        }
-        raduiButton.isHidden = !isMutiSelected
-        raduiButton.isSelected = isSelected
-    }
-
-    func addChildren() {
-        addSubview(hStack)
-        hStack.addArrangedSubview(bgView)
-        hStack.addArrangedSubview(raduiButton)
-
-        bgView.addSubview(bgImageView)
-        bgView.addSubview(iconView)
-        bgView.addSubview(stackView)
-        stackView.addArrangedSubview(titleLabel)
-        stackView.addArrangedSubview(timeLabel)
-        addSubview(lineView)
-    }
-
-    func makeConstraints() {
-        hStack.snp.makeConstraints { make in
-            make.horizontalEdges.equalToSuperview().inset(16)
-            make.verticalEdges.equalToSuperview().inset(8)
-        }
-
-        raduiButton.snp.makeConstraints { make in
-            make.width.equalTo(24)
-        }
-
-        bgImageView.snp.makeConstraints { make in
-            make.edges.equalToSuperview()
-        }
-        iconView.snp.makeConstraints { make in
-            make.leading.equalToSuperview()
-            make.width.height.equalTo(56)
-        }
-        stackView.snp.makeConstraints { make in
-            make.leading.equalTo(iconView.snp.trailing).offset(16)
-            make.centerY.equalTo(iconView)
-            make.trailing.equalToSuperview().offset(-12)
-        }
-        
-        lineView.snp.makeConstraints { make in
-            make.bottom.equalToSuperview()
-            make.horizontalEdges.equalToSuperview().inset(16)
-            make.height.equalTo(1)
-        }
-    }
-
-    required init?(coder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-}

+ 0 - 185
TSLiveWallpaper/Business/TSMusic/Helper/SortMenuViewController.swift

@@ -1,185 +0,0 @@
-//
-//  SortMenuView.swift
-//  ColorfulWallpaper
-//
-//  Created by nkl on 2024/9/10.
-//
-
-import Foundation
-import KLExtension
-import UIKit
-import Localize_Swift
-
-enum SortType {
-    case upTime /// 时间正序
-    case downTime /// 时间倒序
-    case upName /// 名字大小写正序
-    case downName /// 名字大小写倒序
-}
-
-class SortMenuViewController: UIViewController {
-    lazy var dismissArea : UIControl = {
-       let control = UIControl()
-        control.addTarget(self, action: #selector(dismissCurrentVc), for: .touchUpInside)
-        return control
-    }()
-    lazy var bgView: UIView = .simpleView(color: .hexColor("#222222"))
-
-    lazy var titlelabel: UILabel = .simpleLabel(text: "Sort By".localized(),font: .boldSystemFont18,color: .white)
-
-    lazy var closeButton: UIButton = {
-        let btn = UIButton()
-        btn.setImage(UIImage(named: "ic-close"), for: .normal)
-        btn.addTarget(self, action: #selector(dismissCurrentVc), for: .touchUpInside)
-        return btn
-    }()
-
-    lazy var sortbyTimeUp: SortSelectCell = .init(title: "Ascending order by time".localized(), type: .upTime)
-    lazy var sortbyTimeDown: SortSelectCell = .init(title: "Descending order by time".localized(), type: .downTime)
-    lazy var sortbyNameUp: SortSelectCell = .init(title: "Ascending order by name".localized(), type: .upName)
-    lazy var sortbyNameDown: SortSelectCell = .init(title: "Descending order by name".localized(), type: .downName)
-
-    var didSelectedSortType: (SortType) -> Void = { _ in }
-
-    override func viewDidLoad() {
-        super.viewDidLoad()
-        addChildren()
-        makeConstraint()
-    }
-
-    convenience init(type: SortType) {
-        self.init()
-        switch type {
-        case .upTime:
-            sortbyTimeUp.isSelected = true
-        case .downTime:
-            sortbyTimeDown.isSelected = true
-        case .upName:
-            sortbyNameUp.isSelected = true
-        case .downName:
-            sortbyNameDown.isSelected = true
-        }
-    }
-
-    @objc func dismissCurrentVc() {
-        dismiss(animated: true)
-    }
-
-    func addChildren() {
-        view.addSubview(dismissArea)
-        view.addSubview(bgView)
-        bgView.addSubview(titlelabel)
-        bgView.addSubview(closeButton)
-        bgView.addSubview(sortbyTimeUp)
-        bgView.addSubview(sortbyTimeDown)
-        bgView.addSubview(sortbyNameUp)
-        bgView.addSubview(sortbyNameDown)
-
-        sortbyTimeUp.addTarget(self, action: #selector(didSelectedSortAction(sender:)), for: .touchUpInside)
-        sortbyTimeDown.addTarget(self, action: #selector(didSelectedSortAction(sender:)), for: .touchUpInside)
-        sortbyNameUp.addTarget(self, action: #selector(didSelectedSortAction(sender:)), for: .touchUpInside)
-        sortbyNameDown.addTarget(self, action: #selector(didSelectedSortAction(sender:)), for: .touchUpInside)
-    }
-
-    @objc func didSelectedSortAction(sender: SortSelectCell) {
-        didSelectedSortType(sender.type)
-        dismissCurrentVc()
-    }
-
-    func makeConstraint() {
-        dismissArea.snp.makeConstraints { make in
-            make.top.equalToSuperview()
-            make.leading.trailing.equalToSuperview()
-            make.bottom.equalTo(bgView.snp.top)
-        }
-        bgView.snp.makeConstraints { make in
-            make.leading.trailing.bottom.equalToSuperview()
-        }
-
-        titlelabel.snp.makeConstraints { make in
-            make.top.equalToSuperview().offset(30)
-            make.leading.equalToSuperview().offset(16)
-        }
-
-        closeButton.snp.makeConstraints { make in
-            make.top.equalToSuperview().offset(16)
-            make.trailing.equalToSuperview().offset(-16)
-            make.width.height.equalTo(30)
-        }
-
-        sortbyTimeDown.snp.makeConstraints { make in
-            make.top.equalTo(titlelabel.snp.bottom).offset(14)
-            make.leading.trailing.equalToSuperview()
-        }
-        sortbyTimeUp.snp.makeConstraints { make in
-            make.top.equalTo(sortbyTimeDown.snp.bottom).offset(14)
-            make.leading.trailing.equalToSuperview()
-        }
-        sortbyNameDown.snp.makeConstraints { make in
-            make.top.equalTo(sortbyTimeUp.snp.bottom).offset(14)
-            make.leading.trailing.equalToSuperview()
-        }
-        sortbyNameUp.snp.makeConstraints { make in
-            make.top.equalTo(sortbyNameDown.snp.bottom).offset(14)
-            make.leading.trailing.equalToSuperview()
-            make.bottom.equalToSuperview().offset(-80)
-        }
-    }
-
-    override func viewDidLayoutSubviews() {
-        super.viewDidLayoutSubviews()
-        bgView.setRectCorner(corner: [.topLeft, .topRight], radii: .init(width: 16, height: 16))
-    }
-}
-
-class SortSelectCell: UIControl {
-    lazy var selectIcon: UIImageView = .simpleImage(imageName: "ic_check_n")
-    lazy var titleLabel: UILabel = .simpleLabel(text: "Ascending order by time".localized(),font: .systemFont16,color: .white)
-        
-    var type: SortType = .downName
-
-    override var isSelected: Bool {
-        didSet {
-            if isSelected {
-                selectIcon.image = UIImage(named: "ic_check_s")
-            } else {
-                selectIcon.image = UIImage(named: "ic_check_n")
-            }
-        }
-    }
-
-    override init(frame: CGRect) {
-        super.init(frame: frame)
-        addChildren()
-        makeConstraints()
-    }
-
-    convenience init(title: String, type: SortType) {
-        self.init(frame: .zero)
-        titleLabel.text = title
-        self.type = type
-    }
-
-    func addChildren() {
-        addSubview(selectIcon)
-        addSubview(titleLabel)
-    }
-
-    func makeConstraints() {
-        selectIcon.snp.makeConstraints { make in
-            make.leading.equalToSuperview().offset(16)
-            make.width.height.equalTo(20)
-            make.verticalEdges.equalToSuperview().inset(15)
-        }
-
-        titleLabel.snp.makeConstraints { make in
-            make.leading.equalTo(selectIcon.snp.trailing).offset(12)
-            make.trailing.equalToSuperview().offset(-16)
-            make.centerY.equalToSuperview()
-        }
-    }
-
-    required init?(coder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-}

+ 0 - 40
TSLiveWallpaper/Business/TSMusic/Helper/VipTagView.swift

@@ -1,40 +0,0 @@
-//
-//  VipTagView.swift
-//  ColorfulWallpaper
-//
-//  Created by nkl on 2024/9/10.
-//
-
-import Foundation
-import UIKit
-
-class VipTagView: UIView {
-    lazy var bgImageView : UIImageView = .simpleImage(imageName: "icon_wallpaper_reward")
-    lazy var topImageView : UIImageView = UIImageView.init(image: UIImage.init(named: "icon_ad_font_big"))
-    
-    override init(frame: CGRect) {
-        super.init(frame: frame)
-        
-        addSubview(bgImageView)
-        addSubview(topImageView)
-        bgImageView.snp.makeConstraints { make in
-            make.edges.equalToSuperview()
-        }
-        topImageView.snp.makeConstraints { make in
-            make.center.equalToSuperview()
-        }
-    }
-    
-    func set(image: UIImage?,top:UIImage?) {
-        if let image = image {
-            bgImageView.setLocalizedImage(image)
-        }
-        if let topImage = top {
-            topImageView.image = topImage
-        }
-    }
-    
-    required init?(coder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-}

+ 0 - 128
TSLiveWallpaper/Business/TSMusic/Import/ImportFilesManager.swift

@@ -1,128 +0,0 @@
-//
-//  ImportFilesManager.swift
-//  ColorfulWallpaper
-//
-//  Created by nkl on 2024/9/10.
-//
-
-import Foundation
-import TZImagePickerController
-import TSVideoKit
-
-class ImportFilesManager: NSObject, TZImagePickerControllerDelegate , UIDocumentPickerDelegate {
-    
-    static let shared = ImportFilesManager()
-
-    func openPhotoLibrary(parent: UIViewController) {
-        guard let vc = TZImagePickerController(maxImagesCount: 9, delegate: self) else { return }
-        vc.allowPickingImage = false
-        vc.allowPreview = false
-        vc.allowTakeVideo = true
-        vc.allowTakePicture = false
-        vc.allowCameraLocation = false
-        vc.allowPickingMultipleVideo = true
-        vc.allowPickingOriginalPhoto = false
-        vc.naviBgColor = UIColor.white
-        vc.naviTitleColor = UIColor.black
-        vc.pickerDelegate = self
-        parent.present(vc, animated: true)
-    }
-    
-    func imagePickerController(_ picker: TZImagePickerController!, didFinishPickingPhotos photos: [UIImage]!, sourceAssets assets: [Any]!, isSelectOriginalPhoto: Bool) {
-        DispatchQueue.global().async {
-            for asset in assets {
-                if let mAsset = asset as? PHAsset {
-                    TZImageManager.default().requestVideoURL(with: mAsset) { videoUrl in
-                        if let url = videoUrl {
-                            self.copyFileToUrl(url: url)
-                        }
-                    } failure: { _ in
-                    }
-                }
-            }
-        }
-    }
-    
-    
-    func copyFileToUrl(url: URL) {
-        let fileId = UUID().uuidString
-        let path = TSVideoOperator.shared.configuration.fileDir.appendingPathComponent(fileId)
-        let destinationURL = uniqueFileURL(at: path, originalURL: url)
-        do {
-            try FileManager.default.copyItem(at: url, to: destinationURL)
-            Task {
-                await self.importVideo(videoId: fileId, from: destinationURL)
-            }
-
-        } catch {
-            print(error.localizedDescription)
-        }
-    }
-
-    private func importVideo(videoId: String, from url: URL) async {
-        let asset = AVAsset(url: url)
-        let image = await asset.generateThumbnail()
-        
-        await MainActor.run {
-            let title = url.lastPathComponent
-            let pathExt = url.pathExtension.lowercased()
-            let vPath = videoId + "/" + title
-
-            let audios = ["mp3", "wav", "m4a"]
-            var isRing: Bool = false
-            if audios.contains(pathExt) {
-                isRing = true
-            }
-            let imageData = image?.jpegData(compressionQuality: 0.8)
-            let defaultData = UIImage.init(named: "ic_default")?.jpegData(compressionQuality: 0.8)
-            let finalData = imageData ?? defaultData
-            TSVideoOperator.shared.dataManager.createVideo(videoId: videoId, videoUrl: nil, audioStream: nil, videoStream: nil, videoTitle: title, artist: "UnKnown".localized(), artwork: finalData, online: false,customTag: isRing, status: .cached, vPath: vPath) { _ in
-                NotificationCenter.default.post(name: .K_ImportSuccessNotifaction, object: nil)
-            }
-        }
-    }
-    
-    func uniqueFileURL(at directory: URL, originalURL: URL) -> URL {
-        let fileManager = FileManager.default
-
-        // 检查目录是否存在,如果不存在则创建目录
-        if !fileManager.fileExists(atPath: directory.path) {
-            do {
-                try fileManager.createDirectory(at: directory, withIntermediateDirectories: true, attributes: nil)
-            } catch {
-                // 这里可以选择抛出错误或处理错误
-            }
-        }
-
-        let originalFilename = originalURL.deletingPathExtension().lastPathComponent
-        let fileExtension = originalURL.pathExtension
-        var uniqueURL = directory.appendingPathComponent(originalFilename).appendingPathExtension(fileExtension)
-
-        var counter = 1
-        while fileManager.fileExists(atPath: uniqueURL.path) {
-            uniqueURL = directory.appendingPathComponent("\(originalFilename)-\(counter)").appendingPathExtension(fileExtension)
-            counter += 1
-        }
-
-        return uniqueURL
-    }
-    
-    func openFileDocument(parent: UIViewController,completion: ((Bool, String?, URL?) -> Void)?) {
-        let documentTypes = ["public.mp3", "public.movie"]
-        // 音频 mp3,wav,m4a
-        // .MP3; .AAC; .WAV; .WMA; .CDA; .FLAC; .M4A; .MID; .MKA; .MP2; .MPA; .MPC; .APE; .OFR; .OGG; .RA; .WV; .TTA; .AC3; .DTS
-        // 视频 mp4,avi, wmv,mov,mpg(mpeg)
-        let documentVC = UIDocumentPickerViewController(documentTypes: documentTypes, in: .import)
-        //        Appropriate
-        //        let documentVC = UIDocumentPickerViewController(forOpeningContentTypes: [.aiff, .audio, .avi, .wav, .mp3, .movie])
-        documentVC.delegate = self
-        documentVC.modalPresentationStyle = .fullScreen
-        parent.present(documentVC, animated: true)
-    }
-    
-    func documentPicker(_ controller: UIDocumentPickerViewController, didPickDocumentsAt urls: [URL]) {
-        if let first = urls.first {
-            copyFileToUrl(url: first)
-        }
-    }
-}

+ 0 - 103
TSLiveWallpaper/Business/TSMusic/List/Controller/CustomSegementItem.swift

@@ -1,103 +0,0 @@
-//
-//  CustomSegement.swift
-//  TSLiveWallpaper
-//
-//  Created by nkl on 2025/1/20.
-//
-
-import BetterSegmentedControl
-import Foundation
-
-class CustomSegementItem: BetterSegmentedControlSegment {
-    // MARK: Constants
-
-    private struct DefaultValues {
-        static let normalBackgroundColor: UIColor = .clear
-        static let normalTextColor: UIColor = .black
-        static let normalFont: UIFont = .systemFont(ofSize: 13)
-        static let selectedBackgroundColor: UIColor = .clear
-        static let selectedTextColor: UIColor = .black
-        static let selectedFont: UIFont = .systemFont(ofSize: 13, weight: .medium)
-    }
-
-    // MARK: Properties
-
-    public let text: String?
-
-    public let normalFont: UIFont
-    public let normalTextColor: UIColor
-    public let normalBackgroundColor: UIColor
-
-    public let selectedFont: UIFont
-    public let selectedTextColor: UIColor
-    public let selectedBackgroundColor: UIColor
-
-    private let numberOfLines: Int
-    private let accessibilityIdentifier: String?
-
-    // MARK: Lifecycle
-
-    public init(text: String? = nil,
-                numberOfLines: Int = 1,
-                normalBackgroundColor: UIColor? = nil,
-                normalFont: UIFont? = nil,
-                normalTextColor: UIColor? = nil,
-                selectedBackgroundColor: UIColor? = nil,
-                selectedFont: UIFont? = nil,
-                selectedTextColor: UIColor? = nil,
-                accessibilityIdentifier: String? = nil) {
-        self.text = text
-        self.numberOfLines = numberOfLines
-        self.normalBackgroundColor = normalBackgroundColor ?? DefaultValues.normalBackgroundColor
-        self.normalFont = normalFont ?? DefaultValues.normalFont
-        self.normalTextColor = normalTextColor ?? DefaultValues.normalTextColor
-        self.selectedBackgroundColor = selectedBackgroundColor ?? DefaultValues.selectedBackgroundColor
-        self.selectedFont = selectedFont ?? DefaultValues.selectedFont
-        self.selectedTextColor = selectedTextColor ?? DefaultValues.selectedTextColor
-        self.accessibilityIdentifier = accessibilityIdentifier
-    }
-
-    public var intrinsicContentSize: CGSize? {
-        selectedView.intrinsicContentSize
-    }
-
-    public lazy var normalView: UIView = {
-        createLabel(withText: text,
-                    backgroundColor: normalBackgroundColor,
-                    font: normalFont,
-                    textColor: normalTextColor,
-                    accessibilityIdentifier: accessibilityIdentifier, isSelected: false)
-    }()
-
-    public lazy var selectedView: UIView = {
-        createLabel(withText: text,
-                    backgroundColor: selectedBackgroundColor,
-                    font: selectedFont,
-                    textColor: selectedTextColor,
-                    accessibilityIdentifier: accessibilityIdentifier, isSelected: true)
-    }()
-
-    open func createLabel(withText text: String?,
-                          backgroundColor: UIColor,
-                          font: UIFont,
-                          textColor: UIColor,
-                          accessibilityIdentifier: String?,
-                          isSelected: Bool) -> UIView {
-        let bgView: UIImageView = .simpleImage(imageName: "ic_segment_bg")
-        bgView.image = isSelected ?  UIImage(named: "ic_segment_bg") : nil
-        let label = UILabel()
-        label.text = text
-        label.numberOfLines = numberOfLines
-        label.backgroundColor = .clear
-        label.font = font
-        label.textColor = textColor
-        label.lineBreakMode = .byTruncatingTail
-        label.textAlignment = .center
-        label.accessibilityIdentifier = accessibilityIdentifier
-        bgView.addSubview(label)
-        label.snp.makeConstraints { make in
-            make.edges.equalToSuperview()
-        }
-        return bgView
-    }
-}

+ 0 - 157
TSLiveWallpaper/Business/TSMusic/List/Controller/MusicHomeContainerViewController.swift

@@ -1,157 +0,0 @@
-//
-//  MusicContainerViewController.swift
-//  DiaryWallPaper
-//
-//  Created by 倪锴伦 on 2025/1/20.
-//
-
-import ADManager
-import BetterSegmentedControl
-import Foundation
-import TSVideoKit
-
-class MusicHomeContainerViewController: LWBGViewController {
-    lazy var navBar: LWRightNavigationBar = LWRightNavigationBar()
-    lazy var searchBar: MusicSearchBar = MusicSearchBar()
-    weak var importMenuView: BubbleMenuView?
-
-    lazy var importButton: UIButton = {
-        let bt = UIButton(frame: CGRect(x: 0, y: 0, width: 42, height: 42))
-        bt.setImage(.icNavImport, for: .normal)
-        return bt
-    }()
-
-    lazy var songlistVc: SongListViewController = SongListViewController()
-    
-    var viewModel: MusicContainerViewModel = MusicContainerViewModel()
-    
-    lazy var guideBubble: GuideBubbleView = {
-        let guide = GuideBubbleView()
-        guide.addTarget(self, action: #selector(dismissGuideBubble), for: .touchUpInside)
-        guide.tapArea.addTarget(self, action: #selector(bubbleClick), for: .touchUpInside)
-        return guide
-    }()
-
-    override func viewDidLoad() {
-        super.viewDidLoad()
-        bgImageView.image = .viewMainBg
-        addTargets()
-    }
-
-    override func addNotifaction() {
-        super.addNotifaction()
-    }
-
-    override func viewWillAppear(_ animated: Bool) {
-        super.viewWillAppear(animated)
-        PlayerManager.shared.rootVc?.moveUpMiniBar()
-    }
-
-    override func viewDidLayoutSubviews() {
-        super.viewDidLayoutSubviews()
-        print("TSConfiguration.isYs ===", TSConfiguration.isYs)
-        if UserDefaults.standard.string(forKey: "GuideKey") == nil, TSConfiguration.isYs {
-            view.addSubview(guideBubble)
-            view.bringSubviewToFront(guideBubble)
-            guideBubble.snp.makeConstraints { make in
-                make.edges.equalToSuperview()
-            }
-        }
-    }
-
-    func addTargets() {
-        searchBar.addTarget(self, action: #selector(showSearchViewController), for: .touchUpInside)
-        importButton.addTarget(self, action: #selector(showImportMenuView), for: .touchUpInside)
-    }
-
-    @objc func showImportMenuView() {
-        let menuView = BubbleMenuView()
-        menuView.position = FitManager.isAr ? .topLeft : .topRight
-        menuView.actionHanlder = { type in
-            self.menuClick(type: type)
-        }
-        view.addSubview(menuView)
-        menuView.snp.makeConstraints { make in
-            make.trailing.equalToSuperview().offset(-16)
-            make.top.equalTo(self.importButton.snp.bottom).offset(0)
-        }
-        importMenuView = menuView
-    }
-
-    func menuClick(type: ImportSource) {
-        importMenuView?.removeFromSuperview()
-        if type == .library {
-            ImportFilesManager.shared.openPhotoLibrary(parent: self)
-        } else if type == .file {
-            ImportFilesManager.shared.openFileDocument(parent: self, completion: nil)
-        }
-    }
-
-    @objc func bubbleClick() {
-        showSearchViewController()
-        dismissGuideBubble()
-    }
-
-    @objc func dismissGuideBubble() {
-        guideBubble.isHidden = true
-        UserDefaults.standard.setValue("Guide", forKey: "GuideKey")
-    }
-
-    @objc func showSearchViewController() {
-        if PurchaseManager.default.isVip {
-            if TSConfiguration.isYs {
-                let vc = SearchOnlineViewController()
-                vc.hidesBottomBarWhenPushed = true
-                navigationController?.pushViewController(vc, animated: true)
-            } else {
-                let vc = LocalSearchViewController()
-                vc.hidesBottomBarWhenPushed = true
-                navigationController?.pushViewController(vc, animated: true)
-            }
-        } else {
-            ADManager.shared.showAd(scene: ADScene.searchInsert, from: self) { state in
-                if state == .finished || state == .fail {
-                    if TSConfiguration.isYs {
-                        let vc = SearchOnlineViewController()
-                        vc.hidesBottomBarWhenPushed = true
-                        self.navigationController?.pushViewController(vc, animated: true)
-                    } else {
-                        let vc = LocalSearchViewController()
-                        vc.hidesBottomBarWhenPushed = true
-                        self.navigationController?.pushViewController(vc, animated: true)
-                    }
-                }
-            }
-        }
-    }
-
-    override func addChildren() {
-        super.addChildren()
-        view.addSubview(navBar)
-        navBar.appendRightItem(item: importButton)
-        view.addSubview(searchBar)
-        view.addSubview(songlistVc.view)
-        addChild(songlistVc)
-        songlistVc.didMove(toParent: self)
-    }
-
-    override func makeConstarints() {
-        super.makeConstarints()
-        navBar.snp.makeConstraints { make in
-            make.top.equalTo(view.safeAreaLayoutGuide.snp.top)
-            make.horizontalEdges.equalToSuperview()
-            make.height.equalTo(k_Height_NavBar)
-        }
-        searchBar.snp.makeConstraints { make in
-            make.top.equalTo(navBar.snp.bottom)
-            make.horizontalEdges.equalToSuperview().inset(16)
-            make.height.equalTo(44)
-        }
-
-        songlistVc.view.snp.makeConstraints { make in
-            make.top.equalTo(searchBar.snp.bottom).offset(8)
-            make.bottom.equalTo(view.safeAreaLayoutGuide.snp.bottom)
-            make.left.right.equalToSuperview()
-        }
-    }
-}

+ 0 - 162
TSLiveWallpaper/Business/TSMusic/List/Controller/MusicPlaylistContainerViewController.swift

@@ -1,162 +0,0 @@
-//
-//  MusicContainerViewController.swift
-//  DiaryWallPaper
-//
-//  Created by 倪锴伦 on 2025/1/20.
-//
-
-import ADManager
-import BetterSegmentedControl
-import Foundation
-import TSVideoKit
-
-class MusicPlaylistContainerViewController: LWBGViewController {
-    lazy var navBar: LWRightNavigationBar = {
-        let bar = LWRightNavigationBar()
-        bar.iconView.image = .init(named: "ic_nav_playlist")
-        return bar
-    }()
-    
-    lazy var searchBar: MusicSearchBar = MusicSearchBar()
-    weak var importMenuView: BubbleMenuView?
-
-    lazy var importButton: UIButton = {
-        let bt = UIButton(frame: CGRect(x: 0, y: 0, width: 42, height: 42))
-        bt.setImage(.icNavImport, for: .normal)
-        return bt
-    }()
-
-    lazy var playlistVc: PlaylistViewController = PlaylistViewController()
-    
-    var viewModel: MusicContainerViewModel = MusicContainerViewModel()
-    
-    lazy var guideBubble: GuideBubbleView = {
-        let guide = GuideBubbleView()
-        guide.addTarget(self, action: #selector(dismissGuideBubble), for: .touchUpInside)
-        guide.tapArea.addTarget(self, action: #selector(bubbleClick), for: .touchUpInside)
-        return guide
-    }()
-
-    override func viewDidLoad() {
-        super.viewDidLoad()
-        bgImageView.image = .viewMainBg
-        addTargets()
-    }
-
-    override func addNotifaction() {
-        super.addNotifaction()
-    }
-
-    override func viewWillAppear(_ animated: Bool) {
-        super.viewWillAppear(animated)
-        PlayerManager.shared.rootVc?.moveUpMiniBar()
-    }
-
-    override func viewDidLayoutSubviews() {
-        super.viewDidLayoutSubviews()
-        print("TSConfiguration.isYs ===", TSConfiguration.isYs)
-        if UserDefaults.standard.string(forKey: "GuideKey") == nil, TSConfiguration.isYs {
-            view.addSubview(guideBubble)
-            view.bringSubviewToFront(guideBubble)
-            guideBubble.snp.makeConstraints { make in
-                make.edges.equalToSuperview()
-            }
-        }
-    }
-
-    func addTargets() {
-        searchBar.addTarget(self, action: #selector(showSearchViewController), for: .touchUpInside)
-        importButton.addTarget(self, action: #selector(showImportMenuView), for: .touchUpInside)
-    }
-
-    @objc func showImportMenuView() {
-        let menuView = BubbleMenuView()
-        menuView.position = FitManager.isAr ? .topLeft : .topRight
-        menuView.actionHanlder = { type in
-            self.menuClick(type: type)
-        }
-        view.addSubview(menuView)
-        menuView.snp.makeConstraints { make in
-            make.trailing.equalToSuperview().offset(-16)
-            make.top.equalTo(self.importButton.snp.bottom).offset(0)
-        }
-        importMenuView = menuView
-    }
-
-    func menuClick(type: ImportSource) {
-        importMenuView?.removeFromSuperview()
-        if type == .library {
-            ImportFilesManager.shared.openPhotoLibrary(parent: self)
-        } else if type == .file {
-            ImportFilesManager.shared.openFileDocument(parent: self, completion: nil)
-        }
-    }
-
-    @objc func bubbleClick() {
-        showSearchViewController()
-        dismissGuideBubble()
-    }
-
-    @objc func dismissGuideBubble() {
-        guideBubble.isHidden = true
-        UserDefaults.standard.setValue("Guide", forKey: "GuideKey")
-    }
-
-    @objc func showSearchViewController() {
-        if PurchaseManager.default.isVip {
-            if TSConfiguration.isYs {
-                let vc = SearchOnlineViewController()
-                vc.hidesBottomBarWhenPushed = true
-                navigationController?.pushViewController(vc, animated: true)
-            } else {
-                let vc = LocalSearchViewController()
-                vc.hidesBottomBarWhenPushed = true
-                navigationController?.pushViewController(vc, animated: true)
-            }
-        } else {
-            ADManager.shared.showAd(scene: ADScene.searchInsert, from: self) { state in
-                if state == .finished || state == .fail {
-                    if TSConfiguration.isYs {
-                        let vc = SearchOnlineViewController()
-                        vc.hidesBottomBarWhenPushed = true
-                        self.navigationController?.pushViewController(vc, animated: true)
-                    } else {
-                        let vc = LocalSearchViewController()
-                        vc.hidesBottomBarWhenPushed = true
-                        self.navigationController?.pushViewController(vc, animated: true)
-                    }
-                }
-            }
-        }
-    }
-
-    override func addChildren() {
-        super.addChildren()
-        view.addSubview(navBar)
-        navBar.appendRightItem(item: importButton)
-        view.addSubview(searchBar)
-        view.addSubview(playlistVc.view)
-        addChild(playlistVc)
-        playlistVc.didMove(toParent: self)
-    }
-
-    override func makeConstarints() {
-        super.makeConstarints()
-        navBar.snp.makeConstraints { make in
-            make.top.equalTo(view.safeAreaLayoutGuide.snp.top)
-            make.horizontalEdges.equalToSuperview()
-            make.height.equalTo(k_Height_NavBar)
-        }
-        searchBar.snp.makeConstraints { make in
-            make.top.equalTo(navBar.snp.bottom)
-            make.horizontalEdges.equalToSuperview().inset(16)
-            make.height.equalTo(44)
-        }
-
-        playlistVc.view.snp.makeConstraints { make in
-            make.top.equalTo(searchBar.snp.bottom).offset(8)
-            make.bottom.equalTo(view.safeAreaLayoutGuide.snp.bottom)
-            make.left.right.equalToSuperview()
-        }
-    }
-}

+ 0 - 91
TSLiveWallpaper/Business/TSMusic/List/Controller/SongListViewController+Target.swift

@@ -1,91 +0,0 @@
-//
-//  MusicEmptyView.swift
-//  PhysicalWallPaper
-//
-//  Created by nkl on 2024/11/13.
-//
-
-//import ADManager
-import Foundation
-import TSVideoKit
-import ADManager
-
-extension SongListViewController {
-   
-    // 长按手势处理
-    @objc func handleLongPress(_ gesture: UILongPressGestureRecognizer) {
-        let location = gesture.location(in: listView)
-
-        if gesture.state == .began {
-            if let indexPath = listView.indexPathForRow(at: location), indexPath.section == 0 {
-                let ac = UIAlertController(title: nil,
-                                           message: "Are you sure to delete".localized(), preferredStyle: .alert)
-                ac.addAction(UIAlertAction(title: "Cancel".localized(), style: .cancel))
-                ac.addAction(UIAlertAction(title: "Delete".localized(), style: .destructive, handler: { _ in
-                    if indexPath.row < self.viewModel.unFinishedVideo.count {
-                        let viewModel = self.viewModel.unFinishedVideo[indexPath.row]
-                        if let video = viewModel.dataVideo, let videoId = video.videoId {
-                            TSVideoOperator.shared.downloadManager.cancelTask(id: videoId) {
-                                self.viewModel.requestData()
-                            }
-                        }
-                    }
-                }))
-                present(ac, animated: true, completion: nil)
-            }
-        }
-    }
-
-    func tableView(_ tableView: UITableView, willDisplay cell: UITableViewCell, forRowAt indexPath: IndexPath) {
-        if indexPath.section == 0 {
-            guard let cell = cell as? SongDownloadCell, indexPath.row < viewModel.unFinishedVideo.count else {
-                return
-            }
-
-            let viewModel = viewModel.unFinishedVideo[indexPath.row]
-
-            cell.bindViewModel(viewModel: viewModel, isOnline: false)
-
-            cell.downloadStateChangeBlock = { [weak self] state in
-                guard let self = self else {
-                    return
-                }
-                switch state {
-                case .idle(isAnimate: false), .idle(isAnimate: true):
-//                    if PurchaseManager.default.isVip {
-                    viewModel.startDownload()
-//                    if !PurchaseManager.default.isVip {
-//                        ADManager.shared.showAd(scene: ADScene.downloadInsert, from: self)
-//                    }
-//                    } else {
-//                        let loading = ADLoadingViewController()
-//                        loading.adScene = .downloadReward
-//                        loading.finishedHandler = { finished in
-//                            if finished {
-//                                viewModel.startDownload()
-//                            }
-//                        }
-//                        present(loading, animated: false)
-//                    }
-                case .pause:
-                    viewModel.resumeDownload()
-                    break
-                case .done:
-                    if let videoModel = viewModel.dataVideo {
-//                        self.viewModel.showOperationViewController(video: videoModel)
-                    }
-                    break
-                case .downloading:
-                    viewModel.pauseDownload()
-                    break
-                case .retry:
-                    /// todo.kailen
-                    viewModel.retryDownload()
-                    break
-                case .loading:
-                    break
-                }
-            }
-        }
-    }
-}

+ 0 - 271
TSLiveWallpaper/Business/TSMusic/List/Controller/SongListViewController.swift

@@ -1,271 +0,0 @@
-//
-//  MusicEmptyView.swift
-//  PhysicalWallPaper
-//
-//  Created by nkl on 2024/11/13.
-//
-
-import BetterSegmentedControl
-import Combine
-import Foundation
-import GoogleMobileAds
-import KLTips
-import TSVideoKit
-import UIKit
-
-class SongListViewController: LWBGViewController {
-    private var cancellables: [AnyCancellable] = []
-
-    var viewModel: SongListViewModel = SongListViewModel()
-
-    lazy var emptyView: MusicEmptyView = {
-        let empty = MusicEmptyView(title: "No Music".localized(), algin: .top)
-        empty.isHidden = true
-        empty.jumpBtn.addTarget(self, action: #selector(emptyButtonAction), for: .touchUpInside)
-        return empty
-    }()
-
-    lazy var manageButton: UIButton = {
-        let bt = UIButton(frame: CGRect(x: 0, y: 0, width: 42, height: 42))
-        bt.backgroundColor = UIColor.white.withAlphaComponent(0.1)
-        bt.setImage(.icPlaylistMore, for: .normal)
-        bt.customCornerRadius = 20
-        bt.backgroundColor = .white
-        bt.addTarget(self, action: #selector(showMenuAlert), for: .touchUpInside)
-        return bt
-    }()
-
-    lazy var menuView: ManageMenuAlertView = {
-        let mView = ManageMenuAlertView()
-        mView.addTarget(self, action: #selector(dismissAlert(sender:)), for: .touchUpInside)
-        mView.sortButton.addTarget(self, action: #selector(showSortOperateView), for: .touchUpInside)
-        mView.manageButton.addTarget(self, action: #selector(showManageViewController), for: .touchUpInside)
-        return mView
-    }()
-
-    lazy var filterVc: FilterBarViewController = {
-        let vModel = FilterBarViewModel(videos: viewModel.videos, barTyle: .default, selectedVideos: [], sortType: .downTime)
-        let top = FilterBarViewController(viewModel: vModel)
-        top.needSearch = true
-        top.delegate = self
-        return top
-    }()
-
-    lazy var listView: UITableView = {
-        let tabView = UITableView()
-        tabView.dataSource = viewModel
-        tabView.delegate = self
-        tabView.separatorStyle = .none
-        tabView.register(SongListCell.self, forCellReuseIdentifier: "SongListCell")
-        tabView.register(SongDownloadCell.self, forCellReuseIdentifier: "SongDownloadCell")
-        tabView.backgroundColor = .clear
-        tabView.contentInset = UIEdgeInsets(top: 0, left: 0, bottom: 80, right: 0)
-
-        return tabView
-    }()
-
-
-    override func viewDidLoad() {
-        super.viewDidLoad()
-        bgImageView.image = nil
-        navigationController?.navigationBar.isHidden = true
-        navigationItem.leftBarButtonItems?.removeAll()
-        viewModel.requestData()
-        addNotifaction()
-
-        let longPressGesture = UILongPressGestureRecognizer(target: self, action: #selector(handleLongPress(_:)))
-        listView.addGestureRecognizer(longPressGesture)
-    }
-
-    override func addNotifaction() {
-        super.addNotifaction()
-
-        viewModel.$videos.receive(on: DispatchQueue.main).sink { [weak self] videos in
-            guard let self = self else {
-                return
-            }
-            self.filterVc.viewModel?.videos = videos
-            self.filterVc.viewModel?.selectedVideos = []
-            self.filterVc.updateBarInfo()
-            self.filterVc.mutiDoneButtonClicked()
-            self.emptyView.isHidden = !viewModel.isEmptyData
-            self.listView.reloadData()
-        }.store(in: &cancellables)
-
-        NotificationCenter.default.addObserver(self, selector: #selector(reloadDatas), name: .K_ImportSuccessNotifaction, object: nil)
-        NotificationCenter.default.addObserver(self, selector: #selector(reloadDatas), name: kDataChangedNotifactionName, object: nil)
-        NotificationCenter.default.addObserver(self, selector: #selector(reloadDatas), name: .K_RefreshNotifaction, object: nil)
-    }
-
-    @objc func showMenuAlert() {
-        if !view.contains(menuView) {
-            view.addSubview(menuView)
-            menuView.snp.makeConstraints { make in
-                make.top.equalToSuperview()
-                make.horizontalEdges.equalToSuperview()
-                make.bottom.equalTo(view.safeAreaLayoutGuide.snp.bottom)
-            }
-        }
-    }
-
-    @objc func showManageViewController() {
-        menuView.removeFromSuperview()
-    }
-
-    @objc func dismissAlert(sender: UIControl) {
-        sender.removeFromSuperview()
-    }
-
-    @objc func reloadDatas() {
-        viewModel.requestData()
-    }
-
-    override func addChildren() {
-        super.addChildren()
-        view.addSubview(filterVc.view)
-        addChild(filterVc)
-        filterVc.didMove(toParent: self)
-        view.addSubview(listView)
-        view.addSubview(emptyView)
-    }
-
-    @objc func showPlaylist() {
-        let vc = PlaylistViewController()
-        navigationController?.pushViewController(vc, animated: true)
-    }
-
-    @objc func showRecentlyList() {
-        let vModel: PlayListDetaiViewModel = .init()
-        vModel.listType = .recently
-        let vc = PlaylistDetailViewController(viewModel: vModel)
-        vc.hidesBottomBarWhenPushed = true
-        navigationController?.pushViewController(vc, animated: true)
-    }
-
-    override func viewWillAppear(_ animated: Bool) {
-        super.viewWillAppear(animated)
-        PlayerManager.shared.miniBar.isHidden = false
-        PlayerManager.shared.rootVc?.moveUpMiniBar()
-    }
-
-    override func makeConstarints() {
-        super.makeConstarints()
-        filterVc.view.snp.makeConstraints { make in
-            make.top.equalToSuperview()
-            make.horizontalEdges.equalToSuperview().inset(16)
-            make.height.equalTo(46)
-        }
-
-        listView.snp.makeConstraints { make in
-            make.leading.trailing.equalToSuperview()
-            make.bottom.equalTo(view.safeAreaLayoutGuide.snp.bottom)
-            make.top.equalTo(filterVc.view.snp.bottom)
-        }
-        emptyView.snp.makeConstraints { make in
-            make.edges.equalTo(listView)
-        }
-    }
-
-    @objc func showSortOperateView() {
-        menuView.removeFromSuperview()
-        let vc = SortMenuViewController(type: viewModel.sortType)
-        vc.modalPresentationStyle = .overFullScreen
-        vc.didSelectedSortType = { type in
-            self.viewModel.sortType = type
-            self.viewModel.requestData()
-        }
-        present(vc, animated: true)
-    }
-
-
-}
-
-extension SongListViewController: UITableViewDelegate {
-    func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
-        if indexPath.section == 0 {
-            if indexPath.row < viewModel.unFinishedVideo.count {
-                let vModel = viewModel.unFinishedVideo[indexPath.row]
-                switch vModel.state {
-                case .pause:
-                    vModel.resumeDownload()
-                default:
-                    THUD.toast("Downloading".localized())
-                    break
-                }
-            }
-        } else {
-            print("indexPath.row == \(indexPath.row) , count = \(viewModel.videos.count) ")
-            if indexPath.row < viewModel.videos.count {
-                let video = viewModel.videos[indexPath.row]
-                /// 多选模式 禁止点击
-                if viewModel.isMutiSelectModel {
-                    viewModel.addToSelectedList(video: video)
-                    filterVc.viewModel?.selectedVideos = viewModel.selectedVideos
-                    listView.reloadData()
-                } else {
-                    PlayerManager.shared.playVideo(video: video, list: viewModel.videos, scene: .local, onceAdKey: "MinePlayVideo")
-                }
-            }
-        }
-    }
-
-    @objc func emptyButtonAction() {
-        if TSConfiguration.isYs {
-            let vc = SearchOnlineViewController()
-            navigationController?.pushViewController(vc, animated: true)
-        } else {
-            ImportFilesManager.shared.openPhotoLibrary(parent: self)
-        }
-    }
-
-    override func viewWillDisappear(_ animated: Bool) {
-        super.viewWillDisappear(animated)
-        menuView.removeFromSuperview()
-    }
-}
-
-extension SongListViewController: FilterBarViewControllerDelegate {
-    func selectedAllVideo() {
-        if filterVc.viewModel?.selectedVideos.count == viewModel.videos.count {
-            viewModel.selectedVideos = []
-        } else {
-            viewModel.selectedVideos = viewModel.videos
-        }
-        filterVc.viewModel?.selectedVideos = viewModel.selectedVideos
-        listView.reloadData()
-    }
-
-    func doneMutiManage() {
-        viewModel.selectedVideos = []
-        filterVc.viewModel?.selectedVideos = viewModel.selectedVideos
-        listView.reloadData()
-    }
-
-    func localSearchDidClicked() {
-//        if PurchaseManager.default.isVip {
-        let vc = LocalSearchViewController()
-        vc.viewModel.sort = viewModel.sortDescriptor
-        vc.hidesBottomBarWhenPushed = true
-        navigationController?.pushViewController(vc, animated: true)
-//        } else {
-//            ADManager.shared.showAd(scene: ADScene.searchInsert, from: self) { state in
-//                if state == .finished || state == .fail {
-//                    let vc = LocalSearchViewController()
-//                    vc.viewModel.sort = self.viewModel.sortDescriptor
-//                    vc.hidesBottomBarWhenPushed = true
-//                    self.navigationController?.pushViewController(vc, animated: true)
-//                }
-//            }
-//        }
-    }
-
-    func topBarTypeDidChange(barType: MineRingTopType) {
-        viewModel.isMutiSelectModel = barType == .mutiselect
-        listView.reloadData()
-    }
-
-    func sortTypeDidChange(sortType: SortType) {
-        viewModel.sortType = sortType
-        viewModel.requestData()
-    }
-}

+ 0 - 42
TSLiveWallpaper/Business/TSMusic/List/View/CDView.swift

@@ -1,42 +0,0 @@
-//
-//  CDView.swift
-//  PhysicalWallPaper
-//
-//  Created by nkl on 2024/11/22.
-//
-
-import Foundation
-import UIKit
-
-class CDView: UIView {
-    lazy var bgImageView: UIImageView = .simpleImage(imageName: "ic_vinly")
-    lazy var icImageView: UIImageView = .simpleImage(imageName: "ic_default")
-
-    override init(frame: CGRect) {
-        super.init(frame: frame)
-        addChildren()
-        makeConstraints()
-    }
-
-    func addChildren() {
-        addSubview(bgImageView)
-        addSubview(icImageView)
-        icImageView.layer.cornerRadius = 19
-        icImageView.layer.masksToBounds = true
-    }
-
-    func makeConstraints() {
-        bgImageView.snp.makeConstraints { make in
-            make.edges.equalToSuperview()
-        }
-
-        icImageView.snp.makeConstraints { make in
-            make.center.equalToSuperview()
-            make.width.height.equalTo(38)
-        }
-    }
-
-    required init?(coder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-}

+ 0 - 95
TSLiveWallpaper/Business/TSMusic/List/View/PlaylistTopView.swift

@@ -1,95 +0,0 @@
-//
-//  PlaylistTopView.swift
-//  PhysicalWallPaper
-//
-//  Created by nkl on 2024/11/21.
-//
-
-import Foundation
-import TSVideoKit
-import UIKit
-
-class PlaylistTopView: UIControl {
-    lazy var cdOne: CDView = CDView()
-    lazy var cdTwo: CDView = CDView()
-    lazy var cdThree: CDView = CDView()
-
-    lazy var titleLabel: UILabel = .simpleLabel(text: "Playlist".localized(), font: .systemFont16, color: .white.withAlphaComponent(0.8))
-    lazy var countLabel: UILabel = .simpleLabel(text: "0", font: .systemFont14, color: .white.withAlphaComponent(0.4))
-
-    override init(frame: CGRect) {
-        super.init(frame: frame)
-        addChildren()
-        makeConstraints()
-    }
-
-    func bindData(playlists: [TSPlayList]) {
-        countLabel.text = "\(playlists.count)"
-
-        let imageViews = [cdOne.icImageView, cdTwo.icImageView, cdThree.icImageView]
-
-        for (index, imageView) in imageViews.enumerated() {
-            // 检查 playlists 是否有对应的索引
-            if playlists.indices.contains(index) {
-                // 获取图片,如果为空则设置默认图片
-                if playlists[index].firstVideo?.isOnline == true {
-                    imageView.kf.setImage(with: playlists[index].firstVideo?.iconUrl)
-                } else {
-//                    imageView.image = playlists[index].artworkImage ?? UIImage(resource: .icPlayPlaceholder)
-                }
-            } else {
-                // 如果索引超出范围,直接设置默认图片
-//                imageView.image = UIImage(resource: .icPlayPlaceholder)
-            }
-        }
-    }
-
-    func addChildren() {
-        backgroundColor = .white.withAlphaComponent(0.1)
-        layer.cornerRadius = 16
-        layer.masksToBounds = true
-        addSubview(cdThree)
-        addSubview(cdTwo)
-        addSubview(cdOne)
-        cdOne.isUserInteractionEnabled = false
-        cdTwo.isUserInteractionEnabled = false
-        cdThree.isUserInteractionEnabled = false
-
-        addSubview(titleLabel)
-        addSubview(countLabel)
-    }
-
-    func makeConstraints() {
-        cdOne.snp.makeConstraints { make in
-            make.top.equalToSuperview().offset(12)
-            make.leading.equalToSuperview().offset(6)
-            make.width.height.equalTo(80)
-        }
-
-        cdTwo.snp.makeConstraints { make in
-            make.top.equalToSuperview().offset(12)
-            make.leading.equalToSuperview().offset(36)
-            make.width.height.equalTo(80)
-        }
-
-        cdThree.snp.makeConstraints { make in
-            make.top.equalToSuperview().offset(12)
-            make.leading.equalToSuperview().offset(70)
-            make.width.height.equalTo(80)
-        }
-
-        titleLabel.snp.makeConstraints { make in
-            make.leading.equalToSuperview().offset(16)
-            make.bottom.equalTo(countLabel.snp.top).offset(-8)
-        }
-
-        countLabel.snp.makeConstraints { make in
-            make.bottom.equalToSuperview().offset(-12)
-            make.leading.equalToSuperview().offset(16)
-        }
-    }
-
-    required init?(coder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-}

+ 0 - 243
TSLiveWallpaper/Business/TSMusic/List/View/SongDownloadCell.swift

@@ -1,243 +0,0 @@
-//
-//  MusicEmptyView.swift
-//  PhysicalWallPaper
-//
-//  Created by nkl on 2024/11/13.
-//
-
-import Combine
-import Foundation
-import TSVideoKit
-import UIKit
-
-class SongDownloadCell: UITableViewCell {
-    lazy var bgView: UIView = .simpleView(color: .clear)
-
-    lazy var bgImageView: UIImageView = .simpleImage(imageName: "ic_minibar_bg")
-
-    lazy var iconView: UIImageView = {
-        let img: UIImageView = .init()
-        img.customCornerRadius = 12
-        img.contentMode = .scaleAspectFill
-        return img
-    }()
-
-    lazy var titleLabel: UILabel = .simpleLabel(font: .boldSystemFont14, color: .white)
-
-    lazy var timeLabel: UILabel = .simpleLabel(text: "UnKnown".localized(), color: .white.withAlphaComponent(0.4))
-    lazy var stackView: UIStackView = {
-        let stack: UIStackView = .vStack
-        stack.spacing = 8
-        return stack
-    }()
-
-    lazy var lineView: UIView = .simpleView(color: .white.withAlphaComponent(0.1))
-
-    lazy var downloadBtn: DownloadButton = .init()
-
-    private var cancellable: [AnyCancellable] = []
-    private var viewModel: SongDownloadCellViewModel?
-
-    var downloadStateChangeBlock: (DownloadButtonState) -> Void = { _ in }
-
-    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
-        super.init(style: style, reuseIdentifier: reuseIdentifier)
-        backgroundColor = .clear
-        selectionStyle = .none
-        addChildren()
-        makeConstraints()
-    }
-
-    func bindViewModel(viewModel: SongDownloadCellViewModel, isOnline: Bool) {
-        // 清理上次的 cancellables
-        cancellable.forEach { $0.cancel() }
-        cancellable.removeAll()
-
-        self.viewModel = viewModel
-
-        /// 绑定数据
-        var videoId: String = ""
-        if let model = viewModel.dataModel {
-            bindData(video: model)
-            videoId = model.videoId
-        }
-        if let video = viewModel.dataVideo {
-            bindVideo(video: video)
-            videoId = video.videoId ?? ""
-        }
-
-        /// 查找下载器
-        if let mDownloader = TSNewDownloadManager.shared.fetchDownloader(identifier: videoId) {
-            self.viewModel?.downloader = mDownloader
-        } else {
-            self.viewModel?.downloader = nil
-        }
-
-        /// 添加监听
-        self.viewModel?.$downloader
-            .compactMap { $0 }
-            .flatMap { $0.$progress }
-            .receive(on: DispatchQueue.main)
-            .sink { [weak self] progress in
-                self?.downloadBtn.progressView.set(progress: Double(progress))
-            }
-            .store(in: &cancellable)
-
-        self.viewModel?.downloader?.$downloadState
-            .receive(on: DispatchQueue.main)
-            .sink { [weak self] status in
-                self?.setDownloadButtonStates(status: status)
-            }
-            .store(in: &cancellable)
-
-        self.viewModel?.$state.receive(on: DispatchQueue.main).sink(receiveValue: { [weak self] state in
-            self?.downloadBtn.downloadState = state
-        }).store(in: &cancellable)
-    }
-
-    private func bindData(video: VideoOnlineModel) {
-        // 数据库找到数据,直接调video绑定
-        if let mVideo = TSVideoOperator.shared.dataManager.fetchVideo(videoId: video.videoId) {
-            bindVideo(video: mVideo)
-        } else {
-            titleLabel.text = video.title
-            timeLabel.text = video.channelName
-            iconView.kf.setImage(with: video.iconUrl, placeholder: UIImage(named: "ic_default"))
-            // todo.kailen
-            bgImageView.isHidden = PlayerManager.shared.currentVideo?.videoId != video.videoId
-            setDownloadButtonStates(status: .idle)
-        }
-    }
-
-    private func bindVideo(video: TSVideo) {
-        titleLabel.text = video.title ?? "--"
-        if let artist = video.artist {
-            timeLabel.text = artist.isEmpty == true ? "UnKnown".localized() : artist
-        } else {
-            timeLabel.text = "UnKnown".localized()
-        }
-
-        iconView.kf.setImage(with: video.iconUrl, placeholder: UIImage(named: "ic_default"))
-        bgImageView.isHidden = PlayerManager.shared.currentVideo?.videoId != video.videoId
-        downloadBtn.progressView.set(progress: Double(video.progress))
-        setDownloadButtonStates(status: video.videoStatus.asChunkDownloadStatus)
-    }
-
-    func setDownloadButtonStates(status: ChunkDownloadStatus) {
-        switch status {
-        case .idle, .cancel:
-            viewModel?.state = .idle(isAnimate: false)
-            downloadBtn.adTag.isHidden = PurchaseManager.default.isVip
-        case .prasing:
-            viewModel?.state = .loading
-            downloadBtn.adTag.isHidden = true
-        case .praseSuccess:
-            break
-        case .downloading:
-            viewModel?.state = .downloading
-            downloadBtn.adTag.isHidden = true
-        case .pause:
-            viewModel?.state = .pause
-            downloadBtn.adTag.isHidden = true
-        case .failed:
-            viewModel?.state = .retry
-            downloadBtn.adTag.isHidden = true
-        case .finished:
-            viewModel?.state = .done
-            downloadBtn.adTag.isHidden = true
-        }
-    }
-
-    func setDefaultProgress() {
-        downloadBtn.downloadState = .idle(isAnimate: false)
-        downloadBtn.progressView.set(progress: 0)
-    }
-
-    func addChildren() {
-        contentView.addSubview(bgView)
-        bgView.addSubview(bgImageView)
-        bgView.addSubview(iconView)
-        stackView.addArrangedSubview(titleLabel)
-        let space = UIView()
-        stackView.addArrangedSubview(space)
-        stackView.addArrangedSubview(timeLabel)
-        bgView.addSubview(stackView)
-        downloadBtn.adTag.isHidden = PurchaseManager.default.isVip
-        bgView.addSubview(downloadBtn)
-        downloadBtn.addTarget(self, action: #selector(downloadAction(sender:)), for: .touchUpInside)
-        bgView.addSubview(lineView)
-    }
-
-    @objc func downloadAction(sender: DownloadButton) {
-        switch sender.downloadState {
-        case .loading:
-            return
-        default:
-            if let viewModel = viewModel {
-                downloadStateChangeBlock(viewModel.state)
-            }
-        }
-    }
-
-    func makeConstraints() {
-        bgView.snp.makeConstraints { make in
-            make.horizontalEdges.equalToSuperview()
-            make.verticalEdges.equalToSuperview().inset(8)
-        }
-
-        bgImageView.snp.makeConstraints { make in
-            make.edges.equalToSuperview()
-        }
-
-        iconView.snp.makeConstraints { make in
-            make.verticalEdges.equalToSuperview().inset(10)
-            make.leading.equalToSuperview().offset(16)
-            make.width.height.equalTo(56)
-        }
-        stackView.snp.makeConstraints { make in
-            make.leading.equalTo(iconView.snp.trailing).offset(16)
-            make.centerY.equalToSuperview()
-            make.trailing.equalTo(downloadBtn.snp.leading).offset(-12)
-        }
-
-        downloadBtn.snp.makeConstraints { make in
-            make.trailing.equalToSuperview()
-            make.centerY.equalToSuperview()
-            make.width.height.equalTo(64)
-        }
-
-        lineView.snp.makeConstraints { make in
-            make.bottom.equalToSuperview()
-            make.horizontalEdges.equalToSuperview().inset(16)
-            make.height.equalTo(1)
-        }
-    }
-
-    override func prepareForReuse() {
-        super.prepareForReuse()
-        cancellable.forEach { $0.cancel() }
-        cancellable.removeAll()
-        setDefaultProgress()
-    }
-
-    required init?(coder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-}
-
-extension TSVideoStatus {
-    var asChunkDownloadStatus: ChunkDownloadStatus {
-        switch self {
-        case .idle:
-            return .idle
-        case .running:
-            return .downloading
-        case .cached:
-            return .finished
-        case .pause:
-            return .pause
-        case .failed:
-            return .failed
-        }
-    }
-}

+ 0 - 189
TSLiveWallpaper/Business/TSMusic/List/View/SongListCell.swift

@@ -1,189 +0,0 @@
-//
-//  MusicEmptyView.swift
-//  PhysicalWallPaper
-//
-//  Created by nkl on 2024/11/13.
-//
-
-import Foundation
-import TSVideoKit
-import UIKit
-
-class SongListCell: UITableViewCell {
-    var isMuti: Bool = false
-    var needOperate: Bool = true
-
-    lazy var hStack: UIStackView = {
-        let stack: UIStackView = .hStack
-        stack.spacing = 14
-        return stack
-    }()
-
-    lazy var raduiButton: UIButton = {
-        let btn = UIButton()
-        btn.setImage(.icCheckN, for: .normal)
-        btn.setImage(.icCheckS, for: .selected)
-        btn.isHidden = true
-        btn.isUserInteractionEnabled = false
-
-        return btn
-    }()
-
-    lazy var bgView: UIView = .simpleView(color: .clear)
-
-    lazy var lineView: UIView = .simpleView(color: .white.withAlphaComponent(0.1))
-
-    lazy var iconView: UIImageView = {
-        let img: UIImageView = .init(image: UIImage(named: ""))
-        img.customCornerRadius = 8
-        img.contentMode = .scaleAspectFill
-        return img
-    }()
-
-    lazy var titleLabel: UILabel = .simpleLabel(text: "", font: .boldSystemFont14, color: .white)
-    lazy var timeLabel: UILabel = .simpleLabel(text: "UnKnown".localized(), color: .white.withAlphaComponent(0.4))
-    lazy var stackView: UIStackView = {
-        let stack: UIStackView = .vStack
-        stack.spacing = 8
-        return stack
-    }()
-
-    lazy var hContentStack: UIStackView = {
-        let stack: UIStackView = .hStack
-        stack.alignment = .center
-        stack.spacing = 8
-        return stack
-    }()
-
-    lazy var moreButton: UIButton = {
-        let btn = UIButton()
-        btn.setImage(UIImage(named: "icon_more"), for: .normal)
-        btn.addTarget(self, action: #selector(showMoreViewController), for: .touchUpInside)
-        return btn
-    }()
-
-    lazy var playingTag: UIImageView = .simpleImage(imageName: "ic_playing_tag")
-
-    private var mVideo: TSVideo?
-    var mPlaylist: TSPlayList?
-
-    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
-        super.init(style: style, reuseIdentifier: reuseIdentifier)
-        backgroundColor = .clear
-        selectionStyle = .none
-
-        addChildren()
-        makeConstraints()
-    }
-
-    func bindData(video: TSVideo, isMutiSelected: Bool = false, isSelected: Bool = false, needOperate: Bool = false) {
-        mVideo = video
-        self.needOperate = needOperate
-        let isPlaying = video.videoId == PlayerManager.shared.currentVideo?.videoId
-        titleLabel.textColor = isPlaying ? .hexColor("#60FFD2") : .white
-        timeLabel.textColor = isPlaying ? .hexColor("#60FFD2").withAlphaComponent(0.4) : .white.withAlphaComponent(0.4)
-        isMuti = isMutiSelected
-        titleLabel.text = video.title
-        if let artist = video.artist {
-            timeLabel.text = artist.isEmpty == true ? "UnKnown".localized() : video.artist
-        } else {
-            timeLabel.text = "UnKnown".localized()
-        }
-
-        if video.isOnline {
-            iconView.kf.setImage(with: video.iconUrl, placeholder: UIImage(named: "ic_default"))
-        } else {
-            if let imgData = video.artwork {
-                iconView.image = UIImage(data: imgData)
-            } else {
-                iconView.image = UIImage(named: "ic_default")
-            }
-        }
-
-        raduiButton.isHidden = !isMutiSelected
-        raduiButton.isSelected = isSelected
-        moreButton.isHidden = isMutiSelected || !needOperate
-    }
-
-    @objc func showMoreViewController() {
-        let vc = CWOperateViewController()
-        if let playlist = mPlaylist {
-            vc.playlist = playlist
-            vc.types = [.like, .addPlaylist, .removeFromPlaylist, .share, .deleteVideo]
-        } else {
-            vc.types = [.like, .addPlaylist, .share, .deleteVideo]
-        }
-        vc.operteItem = mVideo
-        vc.modalPresentationStyle = .overFullScreen
-        PlayerManager.shared.rootVc?.present(vc, animated: true)
-
-        // todo.kailen
-//        if isMuti {
-//            return
-//        }
-//        let operateTypes: [OperateType]
-//        if isFromPlaylist {
-//            operateTypes = [.edit, .addPlaylist, .like, .removeFromlist, .delete,.share, .ring]
-//        } else {
-//            operateTypes = [.edit, .addPlaylist, .like, .delete,.share, .ring]
-//        }
-//        let vc = RingOperateViewController(operateTypes: operateTypes)
-//        vc.video = mVideo
-//        vc.playlist = mPlaylist
-//        vc.modalPresentationStyle = .overFullScreen
-//        PlayRootController.shared.present(vc, animated: true)
-    }
-
-    func addChildren() {
-        contentView.addSubview(hStack)
-        hStack.addArrangedSubview(bgView)
-        hStack.addArrangedSubview(raduiButton)
-
-        bgView.addSubview(hContentStack)
-        hContentStack.addArrangedSubview(iconView)
-        hContentStack.addArrangedSubview(stackView)
-        hContentStack.addArrangedSubview(playingTag)
-        hContentStack.addArrangedSubview(moreButton)
-        stackView.addArrangedSubview(titleLabel)
-        stackView.addArrangedSubview(timeLabel)
-        contentView.addSubview(lineView)
-    }
-
-    func makeConstraints() {
-        hStack.snp.makeConstraints { make in
-            make.horizontalEdges.equalToSuperview().inset(16)
-            make.verticalEdges.equalToSuperview().inset(8)
-        }
-
-        raduiButton.snp.makeConstraints { make in
-            make.width.equalTo(24)
-        }
-
-        hContentStack.snp.makeConstraints { make in
-            make.edges.equalToSuperview()
-            make.height.equalTo(56)
-        }
-
-        iconView.snp.makeConstraints { make in
-            make.width.height.equalTo(56)
-        }
-
-        playingTag.snp.makeConstraints { make in
-            make.width.equalTo(24)
-        }
-
-        moreButton.snp.makeConstraints { make in
-            make.width.height.equalTo(44)
-        }
-
-        lineView.snp.makeConstraints { make in
-            make.bottom.equalToSuperview()
-            make.horizontalEdges.equalToSuperview().inset(16)
-            make.height.equalTo(1)
-        }
-    }
-
-    required init?(coder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-}

+ 0 - 75
TSLiveWallpaper/Business/TSMusic/List/View/SongListTopView.swift

@@ -1,75 +0,0 @@
-//
-//  SongListTopView.swift
-//  TSLiveWallpaper
-//
-//  Created by nkl on 2024/12/23.
-//
-
-import Foundation
-import UIKit
-
-class SongListTopView: UIView {
-    lazy var hStack: UIStackView = {
-        let stack: UIStackView = .hStack
-        stack.distribution = .fillEqually
-        stack.spacing = 16
-        return stack
-    }()
-
-    lazy var playAllBtn: UIButton = {
-        let btn = createButton(title: "Play All".localized(), image: nil, space: 8)
-        return btn
-    }()
-
-    lazy var shuffleBtn: UIButton = {
-        let btn = createButton(title: "Shuffle All".localized(), image: nil, space: 8)
-        return btn
-    }()
-
-    func createButton(title: String, image: UIImage?, space: CGFloat = 8) -> UIButton {
-        let btn = UIButton()
-        btn.customCornerRadius = 22
-        btn.setTitle(title, for: .normal)
-        btn.setTitleColor(.black, for: .normal)
-        btn.setImage(image, for: .normal)
-        btn.titleLabel?.font = .boldSystemFont(ofSize: 14)
-        btn.backgroundColor = .white.withAlphaComponent(0.6)
-        // 设置图片和标题的间距
-        let spacing: CGFloat = 8 // 间距可以根据需要调整
-        btn.imageEdgeInsets = UIEdgeInsets(top: 0, left: -spacing, bottom: 0, right: spacing)
-        btn.titleEdgeInsets = UIEdgeInsets(top: 0, left: spacing, bottom: 0, right: -spacing)
-        return btn
-    }
-
-    override init(frame: CGRect) {
-        super.init(frame: frame)
-
-        addChildren()
-        makeConstarints()
-    }
-
-    func addChildren() {
-        addSubview(hStack)
-
-        hStack.addArrangedSubview(playAllBtn)
-        hStack.addArrangedSubview(shuffleBtn)
-    }
-
-    func makeConstarints() {
-        hStack.snp.makeConstraints { make in
-            make.edges.equalToSuperview()
-        }
-
-        playAllBtn.snp.makeConstraints { make in
-            make.height.equalTo(44)
-        }
-
-        shuffleBtn.snp.makeConstraints { make in
-            make.height.equalTo(44)
-        }
-    }
-
-    required init?(coder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-}

+ 0 - 12
TSLiveWallpaper/Business/TSMusic/List/ViewModel/MusicContainerViewModel.swift

@@ -1,12 +0,0 @@
-//
-//  MusicContainerViewModel.swift
-//  DiaryWallPaper
-//
-//  Created by 倪锴伦 on 2025/1/20.
-//
-
-import Foundation
-
-class MusicContainerViewModel {
-    
-}

+ 0 - 60
TSLiveWallpaper/Business/TSMusic/List/ViewModel/SongDownloadCellViewModel.swift

@@ -1,60 +0,0 @@
-//
-//  MusicEmptyView.swift
-//  PhysicalWallPaper
-//
-//  Created by nkl on 2024/11/13.
-//
-
-import Combine
-import Foundation
-import TSVideoKit
-
-class SongDownloadCellViewModel {
-    @Published var state: DownloadButtonState = .idle(isAnimate: false)
-    @Published var downloader: NewChunkDownloader?
-
-    var dataModel: VideoOnlineModel?
-    var dataVideo: TSVideo?
-
-    private var cancellables: Set<AnyCancellable> = []
-
-    init(dataModel: VideoOnlineModel?, video: TSVideo?) {
-        self.dataModel = dataModel
-        dataVideo = video
-    }
-
-    func setDownloader(_ downloader: NewChunkDownloader) {
-        self.downloader = downloader
-    }
-
-    func startDownload() {
-        guard let videoId = dataModel?.videoId ?? dataVideo?.videoId else { return }
-        TSNewDownloadManager.shared.downloadVideo(videoId: videoId, isAudio: false) { [weak self] downloader in
-            self?.downloader = downloader
-            NotificationCenter.default.post(name: kDataChangedNotifactionName, object: nil)
-        }
-    }
-
-    func resumeDownload() {
-        guard let videoId = dataModel?.videoId ?? dataVideo?.videoId else { return }
-        TSNewDownloadManager.shared.resumeTask(id: videoId) { [weak self] downloader in
-            self?.downloader = downloader
-            NotificationCenter.default.post(name: kDataChangedNotifactionName, object: nil)
-        }
-    }
-
-    func pauseDownload() {
-        guard let videoId = dataModel?.videoId ?? dataVideo?.videoId else { return }
-        TSNewDownloadManager.shared.pauseTask(id: videoId) { _ in
-            NotificationCenter.default.post(name: kDataChangedNotifactionName, object: nil)
-        }
-    }
-
-    func retryDownload(isAudio: Bool = false) {
-        guard let videoId = dataModel?.videoId ?? dataVideo?.videoId else { return }
-        TSNewDownloadManager.shared.retryDownload(videoId: videoId, isAudio: isAudio) { [weak self] downloader in
-            self?.downloader = downloader
-            NotificationCenter.default.post(name: kDataChangedNotifactionName, object: nil)
-        }
-    }
-}

+ 0 - 162
TSLiveWallpaper/Business/TSMusic/List/ViewModel/SongListViewModel.swift

@@ -1,162 +0,0 @@
-//
-//  MusicEmptyView.swift
-//  PhysicalWallPaper
-//
-//  Created by nkl on 2024/11/13.
-//
-
-import CoreData
-import Foundation
-import TSVideoKit
-import UIKit
-import KLTips
-
-class SongListViewModel: NSObject {
-    @Published var videos: [TSVideo] = []
-    var isMutiSelectModel: Bool = false
-    var selectedVideos: [TSVideo] = []
-    var sortType: SortType = .downTime
-
-    var playLists: [TSPlayList] = []
-    var recentlyVideos  : [TSVideo] = []
-
-    var isEmptyData: Bool {
-        videos.isEmpty && unFinishedVideo.isEmpty
-    }
-
-    var favouriteVideos: [TSVideo] {
-        videos.filter {
-            $0.isFavorite
-        }
-    }
-    
-    
-
-    var sortDescriptor: NSSortDescriptor {
-        let sortDescriptor: NSSortDescriptor
-
-        switch sortType {
-        case .upTime:
-            sortDescriptor = NSSortDescriptor(key: "createdAt", ascending: true)
-        case .downTime:
-            sortDescriptor = NSSortDescriptor(key: "createdAt", ascending: false)
-        case .upName:
-            sortDescriptor = NSSortDescriptor(key: "title", ascending: true, selector: #selector(NSString.localizedStandardCompare(_:)))
-        case .downName:
-            sortDescriptor = NSSortDescriptor(key: "title", ascending: false, selector: #selector(NSString.localizedStandardCompare(_:)))
-        }
-        return sortDescriptor
-    }
-
-    var unFinishedVideo: [SongDownloadCellViewModel] = []
-
-    func requestData() {
-        videos = TSVideoOperator.shared.dataManager.fetchCachedVideos(sort: sortDescriptor)
-        playLists = TSVideoOperator.shared.dataManager.fetchPlaylists()
-        recentlyVideos = TSVideoOperator.shared.dataManager.fetchHistoryVideos()
-        let videos = TSVideoOperator.shared.dataManager.fetchNotCachedVideos()
-        unFinishedVideo = videos.map {
-            SongDownloadCellViewModel(dataModel: nil, video: $0)
-        }
-    }
-}
-
-extension SongListViewModel: UITableViewDataSource {
-    func numberOfSections(in tableView: UITableView) -> Int {
-        return 2
-    }
-
-    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
-        if section == 0 {
-            if isMutiSelectModel {
-                return 0
-            } else {
-                return unFinishedVideo.count
-            }
-
-        } else {
-            return videos.count
-        }
-    }
-
-    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
-        if indexPath.section == 0 {
-            let cell = tableView.dequeueReusableCell(withIdentifier: "SongDownloadCell") as! SongDownloadCell
-            return cell
-        } else {
-            if let cell = tableView.dequeueReusableCell(withIdentifier: "SongListCell") as? SongListCell {
-                if indexPath.row < videos.count {
-                    let videoModel = videos[indexPath.row]
-                    let isSelected = selectedVideos.contains(where: {
-                        $0.videoId == videoModel.videoId
-                    })
-                    cell.bindData(video: videoModel, isMutiSelected: isMutiSelectModel, isSelected: isSelected,needOperate: true)
-                }
-                return cell
-            }
-            return SongListCell()
-        }
-    }
-    
-    func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCell.EditingStyle, forRowAt indexPath: IndexPath) {
-        if indexPath.section == 0 {
-            if indexPath.row < unFinishedVideo.count {
-                let viewModel = unFinishedVideo[indexPath.row]
-                if let video = viewModel.dataVideo, let videoId = video.videoId {
-                    TSVideoOperator.shared.downloadManager.cancelTask(id: videoId) {
-                        self.requestData()
-                    }
-                }
-            }
-        } else {
-            if indexPath.row < videos.count {
-                let ac = UIAlertController(title: nil,
-                                           message: "Are you sure to delete".localized(), preferredStyle: .alert)
-                ac.addAction(UIAlertAction(title: "Cancel".localized(), style: .cancel))
-                ac.addAction(UIAlertAction(title: "Delete".localized(), style: .destructive, handler: { _ in
-
-                    let video = self.videos[indexPath.row]
-                    /// 如果删除视频为当前播放视频,那么minibar 要初始化
-                    if video.videoId == PlayerManager.shared.currentVideo?.videoId {
-                        TSVideoOperator.shared.playerViewModel.clearCurrenVideo()
-                    }
-                    /// 歌单也要删除
-                    PlayerManager.shared.player?.playControl.viewModel.currentVideos.removeAll {
-                        $0.videoId == video.videoId
-                    }
-
-                    TSVideoOperator.shared.dataManager.deleteVideo(video: video) { _ in
-                        self.requestData()
-                    }
-
-                }))
-                PlayerManager.shared.rootVc?.present(ac, animated: true)
-            }
-        }
-    }
-    
-    /// 加入选中列表
-    /// - Parameter video: video
-    func addToSelectedList(video: TSVideo) {
-        // 已经有了,那么删除
-        if selectedVideos.contains(where: {
-            $0.videoId == video.videoId
-        }) {
-            selectedVideos.removeAll(where: {
-                $0.videoId == video.videoId
-            })
-        } else {
-            selectedVideos.append(video)
-        }
-    }
-
-    ///todo.kailen
-//    func showOperationViewController(video: TSVideo) {
-//        let operationVc = RingOperateViewController(operateTypes: [.edit, .addPlaylist, .like, .delete, .share, .ring])
-//        operationVc.video = video
-//        operationVc.presentVc = PlayRootController.shared
-//        operationVc.modalPresentationStyle = .overFullScreen
-//        PlayRootController.shared.present(operationVc, animated: true)
-//    }
-    
-}

+ 0 - 26
TSLiveWallpaper/Business/TSMusic/MusicBase/GradientBackgroundModifier.swift

@@ -1,26 +0,0 @@
-//
-//  GradientButtonView.swift
-//  PhysicalWallPaper
-//
-//  Created by nkl on 2024/11/12.
-//
-
-import Foundation
-import SwiftUI
-
-struct GradientBackgroundModifier: ViewModifier {
-    var colors : [Color]
-
-    func body(content: Content) -> some View {
-        content
-            .background(
-                LinearGradient(gradient: Gradient(colors: colors), startPoint: .leading, endPoint: .trailing)
-            )
-    }
-}
-
-extension View {
-    func gradientBackground(colors:[Color]) -> some View {
-        modifier(GradientBackgroundModifier(colors: colors))
-    }
-}

+ 0 - 44
TSLiveWallpaper/Business/TSMusic/MusicBase/GradientText.swift

@@ -1,44 +0,0 @@
-//
-//  GradientText.swift
-//  PhysicalWallPaper
-//
-//  Created by nkl on 2024/11/12.
-//
-
-import Foundation
-import SwiftUI
-
-struct GradientText: View {
-    var text: String
-    var gradientColors: [Color]
-    var font: Font
-    var backgroundColor: Color = .clear
-    var cornerRadius: CGFloat = 8
-    var verticalPadding: CGFloat = 4
-    var horizontalPadding: CGFloat = 4
-
-    var body: some View {
-        // 外层背景和圆角
-        Text(text)
-            .font(font)
-            .foregroundColor(.clear) // 文字颜色透明
-            .padding(.horizontal, horizontalPadding) // 让背景有一些内边距
-            .padding(.vertical, verticalPadding) // 让背景有一些内边距
-            .background(
-                backgroundColor // 设置背景色
-                    .cornerRadius(cornerRadius) // 圆角背景
-            )
-            .overlay(
-                LinearGradient(
-                    colors: gradientColors,
-                    startPoint: .leading,
-                    endPoint: .trailing
-                )
-                .mask( // 使用文字本身作为遮罩
-                    Text(text)
-                        .font(font)
-                        .padding() // 确保遮罩和背景对齐
-                )
-            )
-    }
-}

+ 0 - 116
TSLiveWallpaper/Business/TSMusic/MusicBase/SaveSuccessTipsView.swift

@@ -1,116 +0,0 @@
-//
-//  SaveSuccessTipsView.swift
-//  PhysicalWallPaper
-//
-//  Created by nkl on 2024/11/8.
-//
-
-import Foundation
-import Photos
-import UIKit
-
-class SaveSuccessTipsView: UIView {
-    lazy var iconView: UIImageView = .simpleImage(imageName: "ic_saved")
-    lazy var textLabel = UILabel()
-    lazy var viewButton: UIButton = {
-        let btn = UIButton()
-        btn.backgroundColor = .hexColor("#111111")
-        btn.setTitle("View", for: .normal)
-        btn.setTitleColor(.hexColor("#6EF4F4"), for: .normal)
-        btn.titleLabel?.font = .boldSystemFont16
-        btn.layer.cornerRadius = 14
-        btn.layer.masksToBounds = true
-        btn.addTarget(self, action: #selector(openPhotoLibrary), for: .touchUpInside)
-        return btn
-    }()
-
-    var viewActionHandler: (() -> Void)?
-
-    override init(frame: CGRect) {
-        super.init(frame: CGRect(x: 0, y: 0, width: 288, height: 48))
-
-        layer.cornerRadius = 8
-        backgroundColor = .white
-
-        addSubview(iconView)
-        iconView.snp.makeConstraints { make in
-            make.width.height.equalTo(24)
-            make.centerY.equalToSuperview()
-            make.leading.equalTo(16)
-        }
-
-        textLabel.textColor = UIColor.black
-        textLabel.font = .boldSystemFont14
-        textLabel.text = "Saved"
-        addSubview(textLabel)
-        textLabel.snp.makeConstraints { make in
-            make.leading.equalTo(iconView.snp.trailing).offset(12)
-            make.centerY.equalToSuperview()
-        }
-
-        addSubview(viewButton)
-        viewButton.snp.makeConstraints { make in
-            make.width.equalTo(64)
-            make.height.equalTo(28)
-            make.centerY.equalToSuperview()
-            make.trailing.equalTo(-12)
-        }
-        viewButton.addTarget(self, action: #selector(buttonClick(_:)), for: .touchUpInside)
-    }
-
-    // 打开相册
-    @objc func openPhotoLibrary() {
-        let photosAppURL = URL(string: "photos-redirect://")!
-
-        if UIApplication.shared.canOpenURL(photosAppURL) {
-            UIApplication.shared.open(photosAppURL, options: [:], completionHandler: nil)
-        } else {
-            print("无法打开照片应用")
-        }
-    }
-
-    required init?(coder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-
-    @objc func buttonClick(_ sender: UIButton) {
-        if let viewActionHandler = viewActionHandler {
-            viewActionHandler()
-        } else {
-//            UIApplication.shared.openPhotoLibrary()
-        }
-    }
-
-    static var isShowing = false
-}
-
-extension SaveSuccessTipsView {
-    static func show(at view: UIView?,
-                     at topOffset: CGFloat? = nil,
-                     viewActionHandler: (() -> Void)? = nil) {
-        guard !Self.isShowing, let view = view else {
-            return
-        }
-        Self.isShowing = true
-        let tip = SaveSuccessTipsView()
-        tip.viewActionHandler = viewActionHandler
-        view.addSubview(tip)
-        tip.snp.makeConstraints { make in
-            make.centerX.equalToSuperview()
-            make.size.equalTo(tip.frame.size)
-            if let topOffset = topOffset {
-                make.top.equalTo(topOffset)
-            } else {
-                make.bottom.equalTo(-200)
-            }
-        }
-        UIImpactFeedbackGenerator(style: .soft).impactOccurred()
-
-        DispatchQueue.global().asyncAfter(deadline: .now() + 2.5) {
-            DispatchQueue.main.async {
-                tip.removeFromSuperview()
-            }
-            Self.isShowing = false
-        }
-    }
-}

+ 0 - 29
TSLiveWallpaper/Business/TSMusic/OC/IJKPlayer/Core/SJIJKMediaPlayer.h

@@ -1,29 +0,0 @@
-//
-//  SJIJKMediaPlayer.h
-//  SJBaseVideoPlayer.common-IJKPlayer
-//
-//  Created by 畅三江 on 2022/8/15.
-//
-
-#import "SJMediaPlaybackController.h"
-@class IJKFFOptions;
-
-NS_ASSUME_NONNULL_BEGIN
-FOUNDATION_EXTERN NSErrorDomain const SJIJKMediaPlayerErrorDomain;
-
-@interface SJIJKMediaPlayer : NSObject<SJMediaPlayer>
-- (instancetype)initWithURL:(NSURL *)URL startPosition:(NSTimeInterval)startPosition options:(IJKFFOptions *)ops;
-
-@property (nonatomic, readonly, strong) NSURL *URL;
-
-@property (nonatomic) NSTimeInterval trialEndPosition;
-
-@property (nonatomic) BOOL pauseWhenAppDidEnterBackground;
-
-@property (nonatomic, readonly) BOOL firstVideoFrameRendered;
-
-@property (nonatomic, readonly) UIView *view;
-
-@property (nonatomic) SJVideoGravity videoGravity;
-@end
-NS_ASSUME_NONNULL_END

+ 0 - 616
TSLiveWallpaper/Business/TSMusic/OC/IJKPlayer/Core/SJIJKMediaPlayer.m

@@ -1,616 +0,0 @@
-//
-//  SJIJKMediaPlayer.m
-//  SJBaseVideoPlayer.common-IJKPlayer
-//
-//  Created by 畅三江 on 2022/8/15.
-//
-
-#import "SJIJKMediaPlayer.h"
-#if __has_include(<IJKMediaPlayerKit/IJKMediaPlayerKit.h>)
-#import <IJKMediaPlayerKit/IJKMediaPlayerKit.h>
-#elif __has_include(<IJKMediaFrameworkWithSSL/IJKMediaFrameworkWithSSL.h>)
-#import <IJKMediaFrameworkWithSSL/IJKMediaFrameworkWithSSL.h>
-#else
-#endif
-#import "NSTimer+SJAssetAdd.h"
-
-NS_ASSUME_NONNULL_BEGIN
-NSErrorDomain const SJIJKMediaPlayerErrorDomain = @"SJIJKMediaPlayerErrorDomain";
-
-typedef struct {
-    BOOL isFinished;
-    IJKMPMovieFinishReason reason;
-} SJIJKMediaPlaybackFinishedInfo;
-
-
-@interface SJIJKMediaPlayer ()
-@property (nonatomic, strong) IJKFFMoviePlayerController *player;
-@property (nonatomic, strong, nullable) NSError *error;
-@property (nonatomic) SJIJKMediaPlaybackFinishedInfo playbackFinishedInfo;
-@property (nonatomic, nullable) SJWaitingReason reasonForWaitingToPlay;
-@property (nonatomic) SJPlaybackTimeControlStatus timeControlStatus;
-@property (nonatomic) SJSeekingInfo seekingInfo;
-@property (nonatomic, copy, nullable) void(^seekCompletionHandler)(BOOL);
-@property (nonatomic) SJAssetStatus assetStatus;
-@property (nonatomic) NSTimeInterval startPosition;
-@property (nonatomic) BOOL needsSeekToStartPosition;
-@property (nonatomic) BOOL firstVideoFrameRendered;
-@property (nonatomic) BOOL isPlaybackFinished;                        ///< 播放结束
-@property (nonatomic, nullable) SJFinishedReason finishedReason;      ///< 播放结束的reason
-
-@property (nonatomic, strong, nullable) NSTimer *refreshTimer;
-@property (nonatomic) NSTimeInterval pre_playbaleTime;
-@property (nonatomic, readonly) BOOL isPlayedToTrialEndPosition;
-@end
-
-@implementation SJIJKMediaPlayer
-@synthesize isPlayed = _isPlayed;
-@synthesize isReplayed = _isReplayed;
-@synthesize rate = _rate;
-@synthesize volume = _volume;
-@synthesize muted = _muted;
-@synthesize pauseWhenAppDidEnterBackground = _pauseWhenAppDidEnterBackground;
-@synthesize presentationSize = _presentationSize;
-
-+ (void)initialize {
-    static dispatch_once_t onceToken;
-    dispatch_once(&onceToken, ^{
-#ifdef SJDEBUG
-        [IJKFFMoviePlayerController setLogReport:YES];
-#else
-        [IJKFFMoviePlayerController setLogReport:NO];
-        [IJKFFMoviePlayerController setLogLevel:k_IJK_LOG_INFO];
-#endif
-    });
-}
-
-- (instancetype)initWithURL:(NSURL *)URL startPosition:(NSTimeInterval)startPosition options:(nonnull IJKFFOptions *)ops {
-    self = [super init];
-    if ( self ) {
-        _volume = 1;
-        _rate = 1;
-        _URL = URL;
-        _startPosition = startPosition;
-        _needsSeekToStartPosition = startPosition != 0;
-        _assetStatus = SJAssetStatusPreparing;
-
-        _player = [IJKFFMoviePlayerController.alloc initWithContentURL:URL withOptions:ops];
-        [NSNotificationCenter.defaultCenter addObserver:self selector:@selector(_preparedToPlayDidChange:) name:IJKMPMediaPlaybackIsPreparedToPlayDidChangeNotification object:_player];
-        [NSNotificationCenter.defaultCenter addObserver:self selector:@selector(_playbackDidFinish:) name:IJKMPMoviePlayerPlaybackDidFinishNotification object:_player];
-        [NSNotificationCenter.defaultCenter addObserver:self selector:@selector(_playbackStateDidChange:) name:IJKMPMoviePlayerPlaybackStateDidChangeNotification object:_player];
-        [NSNotificationCenter.defaultCenter addObserver:self selector:@selector(_loadStateDidChange:) name:IJKMPMoviePlayerLoadStateDidChangeNotification object:_player];
-        [NSNotificationCenter.defaultCenter addObserver:self selector:@selector(_naturalSizeAvailable:) name:IJKMPMovieNaturalSizeAvailableNotification object:_player];
-        
-        [NSNotificationCenter.defaultCenter addObserver:self selector:@selector(_didSeekComplete:) name:IJKMPMoviePlayerDidSeekCompleteNotification object:_player];
-        [NSNotificationCenter.defaultCenter addObserver:self selector:@selector(_seekRenderingStart:) name:IJKMPMoviePlayerSeekAudioStartNotification object:_player];
-        [NSNotificationCenter.defaultCenter addObserver:self selector:@selector(_seekRenderingStart:) name:IJKMPMoviePlayerSeekVideoStartNotification object:_player];
-
-        [NSNotificationCenter.defaultCenter addObserver:self selector:@selector(_firstVideoFrameRendered:) name:IJKMPMoviePlayerFirstVideoFrameRenderedNotification object:_player];
-        
-        [NSNotificationCenter.defaultCenter addObserver:self selector:@selector(_audioSessionInterruption:) name:AVAudioSessionInterruptionNotification object:nil];
-        [NSNotificationCenter.defaultCenter addObserver:self selector:@selector(_audioSessionRouteChange:) name:AVAudioSessionRouteChangeNotification object:nil];
-        [NSNotificationCenter.defaultCenter addObserver:self selector:@selector(_willEnterForeground) name:UIApplicationWillEnterForegroundNotification object:nil];
-        
-        [_player setPauseInBackground:NO];
-        [_player setShouldAutoplay:NO];
-        [_player prepareToPlay];
-    }
-    return self;
-}
-
-- (void)dealloc {
-#ifdef DEBUG
-    NSLog(@"%d \t %s", (int)__LINE__, __func__);
-#endif
-    [_refreshTimer invalidate];
-    [_player.view performSelectorOnMainThread:@selector(removeFromSuperview) withObject:nil waitUntilDone:YES];
-    [_player stop];
-    [_player shutdown];
-    [NSNotificationCenter.defaultCenter removeObserver:self];
-}
-
-- (void)replay {
-    _isReplayed = YES;
-    __weak typeof(self) _self = self;
-    [self seekToTime:kCMTimeZero completionHandler:^(BOOL finished) {
-        __strong typeof(_self) self = _self;
-        if ( !self ) return;
-        if ( self.player.playbackState != IJKMPMoviePlaybackStatePlaying )
-            [self play];
-        
-        [self _postNotification:SJMediaPlayerDidReplayNotification];
-    }];
-}
-
-- (void)report {
-    [self _postNotification:SJMediaPlayerAssetStatusDidChangeNotification];
-    [self _postNotification:SJMediaPlayerTimeControlStatusDidChangeNotification];
-    [self _postNotification:SJMediaPlayerDurationDidChangeNotification];
-    [self _postNotification:SJMediaPlayerPlayableDurationDidChangeNotification];
-}
-
-- (void)play {
-    _isPlayed = YES;
-    
-    if ( self.isPlaybackFinished ) {
-        [self replay];
-    }
-    else {
-        self.reasonForWaitingToPlay = SJWaitingWhileEvaluatingBufferingRateReason;
-        self.timeControlStatus = SJPlaybackTimeControlStatusWaitingToPlay;
-        
-        [_player play];
-    }
-    
-    _player.playbackRate = _rate;
-}
-
-- (void)pause {
-    self.reasonForWaitingToPlay = nil;
-    self.timeControlStatus = SJPlaybackTimeControlStatusPaused;
-    
-    [_player pause];
-    _player.playbackRate = 0;
-}
-
-- (void)stop {
-    self.reasonForWaitingToPlay = nil;
-    self.timeControlStatus = SJPlaybackTimeControlStatusPaused;
-    [_player stop];
-    [_player shutdown];
-
-//    https://github.com/bilibili/ijkplayer/blob/cced91e3ae3730f5c63f3605b00d25eafcf5b97b/ios/IJKMediaPlayer/IJKMediaPlayer/IJKFFMoviePlayerController.m#L434
-//
-//    - (void)setScreenOn: (BOOL)on {
-//        [IJKMediaModule sharedModule].mediaModuleIdleTimerDisabled = on;
-//        // [UIApplication sharedApplication].idleTimerDisabled = on;
-//    }
-//
-//    - (void)shutdown {
-//        if (!_mediaPlayer)
-//            return;
-//
-//        [self stopHudTimer];
-//        [self unregisterApplicationObservers];
-//        [self setScreenOn:NO];
-//
-//        [self performSelectorInBackground:@selector(shutdownWaitStop:) withObject:self];
-//    }
-//
-//    - (void)shutdownWaitStop:(IJKFFMoviePlayerController *) mySelf  {
-//        if (!_mediaPlayer)
-//            return;
-//
-//        ijkmp_stop(_mediaPlayer);
-//        ijkmp_shutdown(_mediaPlayer);
-//
-//        [self performSelectorOnMainThread:@selector(shutdownClose:) withObject:self waitUntilDone:YES];
-//    }
-//
-//    - (void)stop {
-//        if (!_mediaPlayer)
-//            return;
-//
-//        [self setScreenOn:NO];
-//
-//        [self stopHudTimer];
-//        ijkmp_stop(_mediaPlayer);
-//    }
-//
-}
-
-- (void)seekToTime:(CMTime)time completionHandler:(nullable void (^)(BOOL))completionHandler {
-    if ( self.assetStatus != SJAssetStatusReadyToPlay ) {
-        if ( completionHandler ) completionHandler(NO);
-        return;
-    }
-
-    time = [self _adjustSeekTimeIfNeeded:time];
-    BOOL isPlaybackEnded = _playbackFinishedInfo.isFinished;
-    [self _willSeeking:time];
-    _seekCompletionHandler = completionHandler;
-
-    NSTimeInterval secs = CMTimeGetSeconds(time);
-    if ( ceil(secs) == ceil(self.duration) ) secs = secs * 0.98;
-    if ( isPlaybackEnded ) {
-        [self play];
-        dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.05 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
-            self.player.currentPlaybackTime = secs;
-        });
-    }
-    else {
-        self.player.currentPlaybackTime = secs;
-        [self play];
-    }
-}
-
-- (nullable UIImage *)screenshot {
-    return _player.thumbnailImageAtCurrentTime;
-}
-
-- (nullable NSError *)error {
-    return _playbackFinishedInfo.isFinished && _playbackFinishedInfo.reason == IJKMPMovieFinishReasonPlaybackError ? _error : nil;
-}
-
-#pragma mark -
-
-- (UIView *)view {
-    return _player.view;
-}
-
-@synthesize videoGravity = _videoGravity;
-- (void)setVideoGravity:(SJVideoGravity)videoGravity {
-    _videoGravity = videoGravity;
-    IJKMPMovieScalingMode mode = IJKMPMovieScalingModeFill;
-    if ( videoGravity == AVLayerVideoGravityResize )
-        mode = IJKMPMovieScalingModeFill;
-    else if ( videoGravity == AVLayerVideoGravityResizeAspect )
-        mode = IJKMPMovieScalingModeAspectFit;
-    else if ( videoGravity == AVLayerVideoGravityResizeAspectFill )
-        mode = IJKMPMovieScalingModeAspectFill;
-    _player.scalingMode = mode;
-}
- 
-- (SJVideoGravity)videoGravity {
-    return _videoGravity ? : AVLayerVideoGravityResizeAspect;
-}
-
-- (void)setRate:(float)rate {
-    _rate = rate;
-    if ( self.timeControlStatus != SJPlaybackTimeControlStatusPaused )
-        _player.playbackRate = rate;
-}
-
-- (void)setVolume:(float)volume {
-    _volume = volume;
-    _player.playbackVolume = _muted ? 0 : _volume;
-}
-
-- (void)setMuted:(BOOL)muted {
-    _muted = muted;
-    _player.playbackVolume = _muted ? 0 : _volume;
-}
-
-- (void)setPauseWhenAppDidEnterBackground:(BOOL)pauseWhenAppDidEnterBackground {
-    _pauseWhenAppDidEnterBackground = pauseWhenAppDidEnterBackground;
-    [_player setPauseInBackground:pauseWhenAppDidEnterBackground];
-}
-
-- (void)setIsPlaybackFinished:(BOOL)isPlaybackFinished {
-    if ( isPlaybackFinished != _isPlaybackFinished ) {
-        if ( !isPlaybackFinished ) _finishedReason = nil;
-        _isPlaybackFinished = isPlaybackFinished;
-        if ( isPlaybackFinished ) {
-            [self _postNotification:SJMediaPlayerPlaybackDidFinishNotification];
-        }
-    }
-}
-
-- (NSTimeInterval)currentTime {
-    if ( self.isPlaybackFinished ) {
-        if ( self.finishedReason == SJFinishedReasonToEndTimePosition )
-            return self.duration;
-        else if ( self.finishedReason == SJFinishedReasonToTrialEndPosition )
-            return self.trialEndPosition;
-    }
-    return _player.currentPlaybackTime;
-}
-
-- (NSTimeInterval)duration {
-    return _player.duration;
-}
-
-- (NSTimeInterval)playableDuration {
-    NSTimeInterval playableDuration = [_player playableDuration];
-    if ( self.trialEndPosition != 0 && playableDuration >= self.trialEndPosition ) {
-        return self.trialEndPosition;
-    }
-    return playableDuration;
-}
-
-#pragma mark -
-
-- (void)_preparedToPlayDidChange:(NSNotification *)note {
-    dispatch_async(dispatch_get_main_queue(), ^{
-        [self _toEvaluating];
-        [self _postNotification:SJMediaPlayerDurationDidChangeNotification];
-        if ( self.player.isPreparedToPlay && self.assetStatus == SJAssetStatusReadyToPlay && self.needsSeekToStartPosition ) {
-            self.needsSeekToStartPosition = NO;
-            [self seekToTime:CMTimeMakeWithSeconds(self.startPosition, NSEC_PER_SEC) completionHandler:nil];
-        }
-    });
-}
-
-- (void)_playbackStateDidChange:(NSNotification *)note {
-    dispatch_async(dispatch_get_main_queue(), ^{
-        [self _toEvaluating];
-    });
-}
-
-- (void)_loadStateDidChange:(NSNotification *)note {
-    dispatch_async(dispatch_get_main_queue(), ^{
-        [self _toEvaluating];
-    });
-}
-
-- (void)_playbackDidFinish:(NSNotification *)note {
-    dispatch_async(dispatch_get_main_queue(), ^{
-        [self _updatePlaybackFinishedInfo:note];
-        [self _toEvaluating];
-    });
-}
-
-- (void)_naturalSizeAvailable:(NSNotification *)note {
-    dispatch_async(dispatch_get_main_queue(), ^{
-        [self _updatePresentationSize];
-    });
-}
-
-- (void)_didSeekComplete:(NSNotification *)note {
-    if ( [note.userInfo[IJKMPMoviePlayerDidSeekCompleteErrorKey] boolValue] ) {
-        dispatch_async(dispatch_get_main_queue(), ^{
-            [self _didEndSeeking:NO];
-        });
-    }
-}
-
-- (void)_seekRenderingStart:(NSNotification *)note {
-    dispatch_async(dispatch_get_main_queue(), ^{
-        [self _didEndSeeking:YES];
-    });
-
-}
- 
-- (void)_audioSessionInterruption:(NSNotification *)note {
-    NSDictionary *info = note.userInfo;
-    if( (AVAudioSessionInterruptionType)[info[AVAudioSessionInterruptionTypeKey] integerValue] == AVAudioSessionInterruptionTypeBegan ) {
-        [self pause];
-    }
-}
-
-- (void)_audioSessionRouteChange:(NSNotification *)note {
-    dispatch_async(dispatch_get_main_queue(), ^{
-        NSDictionary *interuptionDict = note.userInfo;
-        NSInteger reason = [[interuptionDict valueForKey:AVAudioSessionRouteChangeReasonKey] integerValue];
-        if ( reason == AVAudioSessionRouteChangeReasonOldDeviceUnavailable ) {
-            [self pause];
-        }
-    });
-}
-
-- (void)_firstVideoFrameRendered:(NSNotification *)note {
-    dispatch_async(dispatch_get_main_queue(), ^{
-        self.firstVideoFrameRendered = YES;
-    });
-}
- 
-#pragma mark -
-
-- (void)_toEvaluating {
-    // update asset status
-    SJAssetStatus status = self.assetStatus;
-    if ( _playbackFinishedInfo.isFinished && _playbackFinishedInfo.reason == IJKMPMovieFinishReasonPlaybackError ) {
-        status = SJAssetStatusFailed;
-    }
-    else if ( _player.isPreparedToPlay ) {
-        status = SJAssetStatusReadyToPlay;
-    }
-    
-    if ( status != self.assetStatus ) {
-        self.assetStatus = status;
-    }
-    
-    if ( status == SJAssetStatusFailed ) {
-        self.reasonForWaitingToPlay = nil;
-        self.timeControlStatus = SJPlaybackTimeControlStatusPaused;
-        return;
-    }
-
-    if ( self.isPlayedToTrialEndPosition ) {
-        [self _didPlayToTrialEndPosition];
-        return;
-    }
-    
-    // finished info
-    if ( _playbackFinishedInfo.isFinished && self.timeControlStatus != SJPlaybackTimeControlStatusPaused ) {
-        if ( _playbackFinishedInfo.reason == IJKMPMovieFinishReasonPlaybackEnded ) {
-            self.finishedReason = SJFinishedReasonToEndTimePosition;
-            self.isPlaybackFinished = YES;
-            [self pause];
-        }
-        if ( self.timeControlStatus != SJPlaybackTimeControlStatusPaused ) {
-            self.reasonForWaitingToPlay = nil;
-            self.timeControlStatus = SJPlaybackTimeControlStatusPaused;
-        }
-        return;
-    }
-
-    // update timeControl status
-    if ( self.timeControlStatus != SJPlaybackTimeControlStatusPaused ) {
-        SJPlaybackTimeControlStatus status = self.timeControlStatus;
-        SJWaitingReason _Nullable  reason = self.reasonForWaitingToPlay;
-        if ( _player.loadState & IJKMPMovieLoadStateStalled ) {
-            reason = SJWaitingToMinimizeStallsReason;
-            status = SJPlaybackTimeControlStatusWaitingToPlay;
-        }
-        else if ( _player.loadState & IJKMPMovieLoadStatePlayable ) {
-            reason = nil;
-            status = SJPlaybackTimeControlStatusPlaying;
-        }
-        
-        if ( status != self.timeControlStatus || reason != self.reasonForWaitingToPlay ) {
-            self.reasonForWaitingToPlay = reason;
-            self.timeControlStatus = status;
-        }
-    }
-    
-    // resume playback
-    if ( self.assetStatus == SJAssetStatusReadyToPlay ) {
-        if ( self.timeControlStatus != SJPlaybackTimeControlStatusPaused &&
-            _player.playbackState == IJKMPMoviePlaybackStatePaused ) {
-            [_player play];
-        }
-    }
-}
-
-- (void)_updatePresentationSize {
-    CGSize oldSize = self.presentationSize;
-    CGSize newSize = _player.naturalSize;
-    if ( !CGSizeEqualToSize(oldSize, newSize) ) {
-        _presentationSize = newSize;
-        [self _postNotification:SJMediaPlayerPresentationSizeDidChangeNotification];
-    }
-}
-
-- (void)_updatePlaybackFinishedInfo:(NSNotification *)note {
-    IJKMPMovieFinishReason reason = [note.userInfo[IJKMPMoviePlayerPlaybackDidFinishReasonUserInfoKey] integerValue];
-    if ( reason == IJKMPMovieFinishReasonPlaybackError ) {
-        _error = [NSError errorWithDomain:SJIJKMediaPlayerErrorDomain code:reason userInfo:@{
-            @"ijkerror" : note
-        }];
-    }
-    _playbackFinishedInfo.isFinished = YES;
-    _playbackFinishedInfo.reason = reason;
-    [self _toEvaluating];
-}
-
-- (void)_postNotification:(NSNotificationName)name {
-    dispatch_async(dispatch_get_main_queue(), ^{
-        [NSNotificationCenter.defaultCenter postNotificationName:name object:self];
-    });
-}
-
-- (void)_willSeeking:(CMTime)time {
-    _playbackFinishedInfo.reason = 0;
-    _playbackFinishedInfo.isFinished = NO;
-    self.isPlaybackFinished = NO;
-    _seekingInfo.time = time;
-    _seekingInfo.isSeeking = YES;
-}
-
-- (void)_didEndSeeking:(BOOL)finished {
-    if ( _seekingInfo.isSeeking ) {
-        _seekingInfo.time = kCMTimeZero;
-        _seekingInfo.isSeeking = NO;
-        if ( _seekCompletionHandler != nil ) _seekCompletionHandler(finished);
-        _seekCompletionHandler = nil;
-    }
-}
-
-- (void)_willEnterForeground {
-    if ( self.timeControlStatus == SJPlaybackTimeControlStatusPaused )
-        [self pause];
-    else
-        [self play];
-}
-
-#pragma mark - log
-
-- (void)setAssetStatus:(SJAssetStatus)assetStatus {
-    _assetStatus = assetStatus;
-    
-#ifdef SJDEBUG
-    switch ( assetStatus ) {
-        case SJAssetStatusUnknown:
-            printf("SJMediaPlayer.assetStatus.Unknown\n");
-            break;
-        case SJAssetStatusPreparing:
-            printf("SJMediaPlayer.assetStatus.Preparing\n");
-            break;
-        case SJAssetStatusReadyToPlay:
-            printf("SJMediaPlayer.assetStatus.ReadyToPlay\n");
-            break;
-        case SJAssetStatusFailed:
-            printf("SJMediaPlayer.assetStatus.Failed\n");
-            break;
-    }
-#endif
-    
-    [self _postNotification:SJMediaPlayerAssetStatusDidChangeNotification];
-}
-
-- (void)setTimeControlStatus:(SJPlaybackTimeControlStatus)timeControlStatus {
-    _timeControlStatus = timeControlStatus;
-
-    [self _refreshOrStop];
-    
-#ifdef SJDEBUG
-    switch ( timeControlStatus ) {
-        case SJPlaybackTimeControlStatusPaused:
-            printf("SJMediaPlayer.timeControlStatus.Pause\n");
-            break;
-        case SJPlaybackTimeControlStatusWaitingToPlay:
-            printf("SJMediaPlayer.timeControlStatus.WaitingToPlay.reason(%s)\n", _reasonForWaitingToPlay.UTF8String);
-            break;
-        case SJPlaybackTimeControlStatusPlaying:
-            printf("SJMediaPlayer.timeControlStatus.Playing\n");
-            break;
-    }
-#endif
-    
-    [self _postNotification:SJMediaPlayerTimeControlStatusDidChangeNotification];
-}
-
-- (BOOL)isPlayedToTrialEndPosition {
-    return self.trialEndPosition != 0 && self.currentTime >= self.trialEndPosition;
-}
-
-- (void)_didPlayToTrialEndPosition {
-    if ( self.finishedReason != SJFinishedReasonToTrialEndPosition ) {
-        self.finishedReason = SJFinishedReasonToTrialEndPosition;
-        self.isPlaybackFinished = YES;
-        [self pause];
-    }
-}
-
-- (void)_didPlayToEndPositoion {
-    if ( self.finishedReason != SJFinishedReasonToEndTimePosition ) {
-        self.finishedReason = SJFinishedReasonToEndTimePosition;
-        self.isPlaybackFinished = YES;
-        self.reasonForWaitingToPlay = nil;
-        self.timeControlStatus = SJPlaybackTimeControlStatusPaused;
-    }
-}
-
-- (CMTime)_adjustSeekTimeIfNeeded:(CMTime)time {
-    if ( _trialEndPosition != 0 && CMTimeGetSeconds(time) >= _trialEndPosition ) {
-        time = CMTimeMakeWithSeconds(_trialEndPosition * 0.98, NSEC_PER_SEC);
-    }
-    return time;
-}
-
-- (void)_refreshOrStop {
-    
-    if ( self.timeControlStatus == SJPlaybackTimeControlStatusPaused ) {
-        if ( _refreshTimer != nil ) {
-            [_refreshTimer invalidate];
-            _refreshTimer = nil;
-        }
-    }
-    else if ( _refreshTimer == nil ) {
-        __weak typeof(self) _self = self;
-        _refreshTimer = [NSTimer sj_timerWithTimeInterval:0.5 repeats:YES usingBlock:^(NSTimer * _Nonnull timer) {
-            __strong typeof(_self) self = _self;
-            if ( !self ) {
-                [timer invalidate];
-                return ;
-            }
-            
-            if ( self.isPlayedToTrialEndPosition ) {
-                [self _didPlayToTrialEndPosition];
-                return;
-            }
-            
-            NSTimeInterval playableDuration = self.playableDuration;
-            if ( floor(self.pre_playbaleTime + 0.5) != floor(playableDuration + 0.5) ) {
-                self.pre_playbaleTime = playableDuration;
-                [self _postNotification:SJMediaPlayerPlayableDurationDidChangeNotification];
-            }
-        }];
-        
-        [_refreshTimer sj_fire];
-        [NSRunLoop.mainRunLoop addTimer:_refreshTimer forMode:NSRunLoopCommonModes];
-    }
-}
-@end
-NS_ASSUME_NONNULL_END

+ 0 - 24
TSLiveWallpaper/Business/TSMusic/OC/IJKPlayer/Core/SJIJKMediaPlayerLayerView.h

@@ -1,24 +0,0 @@
-//
-//  SJIJKMediaPlayerLayerView.h
-//  Pods
-//
-//  Created by BlueDancer on 2020/2/19.
-//
-
-#import <UIKit/UIKit.h>
-#import "SJMediaPlaybackController.h"
-#import "SJIJKMediaPlayer.h"
-
-NS_ASSUME_NONNULL_BEGIN
-
-@interface SJIJKMediaPlayerLayerView : UIView<SJMediaPlayerView>
-- (instancetype)initWithPlayer:(SJIJKMediaPlayer *)player;
-
-@property (nonatomic, strong, readonly) SJIJKMediaPlayer *player;
-
-@property (nonatomic) SJVideoGravity videoGravity;
-@property (nonatomic, readonly, getter=isReadyForDisplay) BOOL readyForDisplay;
-
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 46
TSLiveWallpaper/Business/TSMusic/OC/IJKPlayer/Core/SJIJKMediaPlayerLayerView.m

@@ -1,46 +0,0 @@
-//
-//  SJIJKMediaPlayerLayerView.m
-//  Pods
-//
-//  Created by BlueDancer on 2020/2/19.
-//
-
-#import "SJIJKMediaPlayerLayerView.h"
-
-@implementation SJIJKMediaPlayerLayerView
-- (instancetype)initWithPlayer:(SJIJKMediaPlayer *)player {
-    self = [super init];
-    if ( self ) {
-        _player = player;
-        [self addSubview:_player.view];
-        [self setVideoGravity:AVVideoScalingModeResizeAspect];
-        [player addObserver:self forKeyPath:@"firstVideoFrameRendered" options:NSKeyValueObservingOptionNew context:NULL];
-    }
-    return self;
-}
-
-- (void)layoutSubviews {
-    [super layoutSubviews];
-    _player.view.frame = self.bounds;
-}
-
-- (void)dealloc {
-    [_player removeObserver:self forKeyPath:@"firstVideoFrameRendered"];
-}
-
-- (void)observeValueForKeyPath:(nullable NSString *)keyPath ofObject:(nullable id)object change:(nullable NSDictionary<NSKeyValueChangeKey,id> *)change context:(nullable void *)context {
-    [NSNotificationCenter.defaultCenter postNotificationName:SJMediaPlayerViewReadyForDisplayNotification object:self];
-}
-
-- (void)setVideoGravity:(SJVideoGravity)videoGravity {
-    _player.videoGravity = videoGravity;
-}
-
-- (SJVideoGravity)videoGravity {
-    return _player.videoGravity;
-}
-
-- (BOOL)isReadyForDisplay {
-    return _player.firstVideoFrameRendered;
-}
-@end

+ 0 - 0
TSLiveWallpaper/Business/TSMusic/OC/IJKPlayer/IJKPlayer.md


+ 0 - 22
TSLiveWallpaper/Business/TSMusic/OC/IJKPlayer/SJIJKMediaPlaybackController.h

@@ -1,22 +0,0 @@
-//
-//  SJIJKMediaPlaybackController.h
-//  SJVideoPlayer_Example
-//
-//  Created by BlueDancer on 2019/10/12.
-//  Copyright © 2019 changsanjiang. All rights reserved.
-//
-
-#import <Foundation/Foundation.h>
-#import "SJMediaPlaybackController.h"
-#import "SJIJKMediaPlayer.h"
-@class IJKFFOptions;
-
-NS_ASSUME_NONNULL_BEGIN
-@interface SJIJKMediaPlaybackController : SJMediaPlaybackController
-
-@property (nonatomic, strong, null_resettable) IJKFFOptions *options;
-
-@property (nonatomic, strong, readonly, nullable) SJIJKMediaPlayer *currentPlayer;
-
-@end
-NS_ASSUME_NONNULL_END

+ 0 - 95
TSLiveWallpaper/Business/TSMusic/OC/IJKPlayer/SJIJKMediaPlaybackController.m

@@ -1,95 +0,0 @@
-//
-//  SJIJKMediaPlaybackController.m
-//  SJVideoPlayer_Example
-//
-//  Created by BlueDancer on 2019/10/12.
-//  Copyright © 2019 changsanjiang. All rights reserved.
-//
-
-#import "SJIJKMediaPlaybackController.h"
-#import "SJIJKMediaPlayerLayerView.h"
-
-#if __has_include(<SJUIKit/SJRunLoopTaskQueue.h>)
-#import <SJUIKit/SJRunLoopTaskQueue.h>
-#else
-#import "SJRunLoopTaskQueue.h"
-#endif
-
-#if __has_include(<IJKMediaPlayerKit/IJKMediaPlayerKit.h>)
-#import <IJKMediaPlayerKit/IJKMediaPlayerKit.h>
-#elif __has_include(<IJKMediaFrameworkWithSSL/IJKMediaFrameworkWithSSL.h>)
-#import <IJKMediaFrameworkWithSSL/IJKMediaFrameworkWithSSL.h>
-#else
-#endif
-
-NS_ASSUME_NONNULL_BEGIN
-@interface SJIJKMediaPlaybackController ()
-
-@end
-
-@implementation SJIJKMediaPlaybackController
-@dynamic currentPlayer;
-
-- (IJKFFOptions *)options {
-    if (_options == nil) {
-        _options = IJKFFOptions.optionsByDefault;
-        // 可选设置:开启重连
-        [_options setOptionIntValue:0 forKey:@"reconnect" ofCategory:kIJKFFOptionCategoryPlayer];
-        [_options setOptionIntValue:0 forKey:@"reconnect" ofCategory:kIJKFFOptionCategoryFormat];
-        [_options setOptionIntValue:1 forKey:@"loglevel" ofCategory:kIJKFFOptionCategoryPlayer];
-
-    }
-    return _options;
-}
-
-- (void)playerWithMedia:(SJVideoPlayerURLAsset *)media completionHandler:(void (^)(id<SJMediaPlayer> _Nullable))completionHandler {
-    __weak typeof(self) _self = self;
-    SJRunLoopTaskQueue.main.enqueue(^{
-        __strong typeof(_self) self = _self;
-
-        if (!self) {
-            return;
-        }
-
-        SJIJKMediaPlayer *player = [SJIJKMediaPlayer.alloc initWithURL:media.mediaURL startPosition:media.startPosition options:self.options];
-        player.pauseWhenAppDidEnterBackground = self.pauseWhenAppDidEnterBackground;
-        
-        if (completionHandler) {
-            completionHandler(player);
-        }
-    });
-}
-
-- (UIView<SJMediaPlayerView> *)playerViewWithPlayer:(SJIJKMediaPlayer *)player {
-    return [SJIJKMediaPlayerLayerView.alloc initWithPlayer:player];
-}
-
-- (void)setPauseWhenAppDidEnterBackground:(BOOL)pauseWhenAppDidEnterBackground {
-    [super setPauseWhenAppDidEnterBackground:pauseWhenAppDidEnterBackground];
-    self.currentPlayer.pauseWhenAppDidEnterBackground = pauseWhenAppDidEnterBackground;
-}
-
-#pragma mark -
-
-- (void)setMinBufferedDuration:(NSTimeInterval)minBufferedDuration {
-#ifdef DEBUG
-    NSLog(@"%d \t %s \t 未实现该方法!", (int)__LINE__, __func__);
-#endif
-}
-
-- (NSTimeInterval)durationWatched {
-#ifdef DEBUG
-    NSLog(@"%d \t %s \t 未实现该方法!", (int)__LINE__, __func__);
-#endif
-    return 0;
-}
-
-- (SJPlaybackType)playbackType {
-#ifdef DEBUG
-    NSLog(@"%d \t %s \t 未实现该方法!", (int)__LINE__, __func__);
-#endif
-    return SJPlaybackTypeUnknown;
-}
-
-@end
-NS_ASSUME_NONNULL_END

+ 0 - 8
TSLiveWallpaper/Business/TSMusic/OC/IJKPlayer/TSAvatar-Header.h

@@ -1,8 +0,0 @@
-//
-//  PhysicalWallPaper-Header.h
-//  PhysicalWallPaper
-//
-//  Created by nkl on 2024/11/27.
-//
-
-#import "SJIJKMediaPlaybackController.h"

+ 0 - 208
TSLiveWallpaper/Business/TSMusic/PlayList/Controller/AddPlayListViewController.swift

@@ -1,208 +0,0 @@
-//
-//  AddPlayListViewController.swift
-//  ColorfulWallpaper
-//
-//  Created by ni on 2024/9/19.
-//
-
-import Combine
-import Foundation
-import KLTips
-import TSVideoKit
-
-class AddPlayListViewController: LWBaseViewController, UITableViewDelegate {
-    var viewModel: AddPlayListViewModel = .init()
-    lazy var backView: UIView = .simpleView(color: .hexColor("#222222"))
-    lazy var listView: UITableView = {
-        let tabView = UITableView()
-        tabView.dataSource = viewModel
-        tabView.delegate = self
-        tabView.separatorStyle = .none
-        tabView.register(PlayListCell
-            .self, forCellReuseIdentifier: "PlayListCell")
-        tabView.register(PlayListAddCell.self, forCellReuseIdentifier: "PlayListAddCell")
-        tabView.backgroundColor = .clear
-        tabView.contentInset = UIEdgeInsets(top: 0, left: 0, bottom: 80, right: 0)
-        return tabView
-    }()
-
-    lazy var titleLabel: UILabel = .simpleLabel(text: "Add to Playlist".localized(), font: .boldSystemFont18, color: .white)
-    lazy var closeButton: UIButton = {
-        let btn = UIButton()
-        btn.setImage(UIImage(named: "ic-close"), for: .normal)
-        btn.addTarget(self, action: #selector(dismissCurrent), for: .touchUpInside)
-        return btn
-    }()
-
-    lazy var disappearArea: UIControl = .init()
-
-    private var canncellable: [AnyCancellable] = []
-
-    var addSuccessBlock: () -> Void = {}
-
-    var video: TSVideo?
-    var videos: [TSVideo] = []
-
-    convenience init(video: TSVideo) {
-        self.init()
-        self.video = video
-        viewModel.needMore = false
-    }
-
-    convenience init(videos: [TSVideo]) {
-        self.init()
-        self.videos = videos
-        viewModel.needMore = false
-    }
-
-    override func viewDidLoad() {
-        super.viewDidLoad()
-        navigationController?.navigationBar.isHidden = true
-        addNotifaction()
-    }
-
-    override func viewWillAppear(_ animated: Bool) {
-        super.viewWillAppear(animated)
-        viewModel.requestData()
-    }
-
-    override func viewWillDisappear(_ animated: Bool) {
-        super.viewWillDisappear(animated)
-    }
-
-    override func addNotifaction() {
-        super.addNotifaction()
-
-        viewModel.$playLists.receive(on: DispatchQueue.main).sink { _ in
-            self.listView.reloadData()
-        }.store(in: &canncellable)
-
-        NotificationCenter.default.addObserver(self, selector: #selector(reloadData), name: .K_RefreshNotifaction, object: nil)
-    }
-
-    @objc func reloadData() {
-        viewModel.requestData()
-    }
-
-    func newPlaylist() {
-        let alertVC = UIAlertController(title: nil, message: "Playlist Name".localized(), preferredStyle: .alert)
-        alertVC.addTextField { textField in
-            textField.placeholder = "input name".localized()
-            textField.font = UIFont.systemFont(ofSize: 16)
-        }
-        let ok = UIAlertAction(title: "OK".localized(), style: .default) { [weak self] _ in
-            if let name = alertVC.textFields?.first?.text, !name.isEmpty {
-                self?.viewModel.creatPlayList(name: name) { listid in
-                    if let id = listid {
-                        self?.didFinishedCreatedPlaylist(id: id)
-                    }
-                }
-            }
-        }
-        let cancel = UIAlertAction(title: "Cancel".localized(), style: .cancel)
-        alertVC.addAction(cancel)
-        alertVC.addAction(ok)
-        present(alertVC, animated: true)
-    }
-
-    override func addChildren() {
-        super.addChildren()
-        disappearArea.backgroundColor = .black.withAlphaComponent(0.4)
-        disappearArea.addTarget(self, action: #selector(dismissCurrent), for: .touchUpInside)
-        backView.layer.cornerRadius = 16
-        backView.layer.masksToBounds = true
-        view.addSubview(disappearArea)
-        view.addSubview(backView)
-        backView.addSubview(titleLabel)
-        backView.addSubview(closeButton)
-        backView.addSubview(listView)
-    }
-
-    @objc func dismissCurrent() {
-        dismiss(animated: true)
-    }
-
-    override func makeConstarints() {
-        super.makeConstarints()
-        disappearArea.snp.makeConstraints { make in
-            make.leading.trailing.top.equalToSuperview()
-            make.bottom.equalTo(backView.snp.top)
-        }
-        backView.snp.makeConstraints { make in
-            make.bottom.leading.trailing.equalToSuperview()
-            make.height.equalToSuperview().multipliedBy(0.6)
-        }
-
-        titleLabel.snp.makeConstraints { make in
-            make.top.equalToSuperview()
-            make.leading.equalToSuperview().offset(16)
-            make.height.equalTo(54)
-        }
-
-        closeButton.snp.makeConstraints { make in
-            make.width.height.equalTo(54)
-            make.trailing.equalToSuperview()
-            make.centerY.equalTo(titleLabel)
-        }
-
-        listView.snp.makeConstraints { make in
-            make.top.equalTo(titleLabel.snp.bottom)
-            make.bottom.leading.trailing.equalToSuperview()
-        }
-    }
-
-    func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
-        if indexPath.section == 0 {
-            newPlaylist()
-        } else {
-            if indexPath.row >= viewModel.playLists.count {
-                return
-            }
-            let playList = viewModel.playLists[indexPath.row]
-            if videos.isEmpty {
-                addToPlayList(playlist: playList)
-            } else {
-                addVideosToPlaylist(playlist: playList)
-            }
-            reloadData()
-        }
-    }
-
-    func didFinishedCreatedPlaylist(id: UUID) {
-        if let playlist = TSVideoOperator.shared.dataManager.fetchPlaylist(id: id) {
-            if videos.isEmpty {
-                addToPlayList(playlist: playlist)
-            } else {
-                addVideosToPlaylist(playlist: playlist)
-            }
-        }
-    }
-
-    func addVideosToPlaylist(playlist: TSPlayList) {
-        TSVideoOperator.shared.dataManager.addVideosToPlaylist(videos: videos, to: playlist) { _ in
-
-            dismiss(animated: true) {
-                self.addSuccessBlock()
-            }
-        }
-    }
-
-    func addToPlayList(playlist: TSPlayList) {
-        if let mVideo = video {
-            TSVideoOperator.shared.dataManager.addVideoToPlaylist(video: mVideo, to: playlist) { success in
-                if !success {
-                    THUD.toast("Already Exists".localized())
-                } else {
-                    dismiss(animated: true) {
-                        self.addSuccessBlock()
-                    }
-                }
-            }
-        }
-    }
-
-    deinit {
-        NotificationCenter.default.removeObserver(self)
-        canncellable.removeAll()
-    }
-}

+ 0 - 122
TSLiveWallpaper/Business/TSMusic/PlayList/Controller/PlayDetailListViewContoller.swift

@@ -1,122 +0,0 @@
-//
-//  PlayDetaiListViewContoller.swift
-//  ColorfulWallpaper
-//
-//  Created by ni on 2024/9/19.
-//
-
-import Foundation
-import UIKit
-
-class PlayDetailListViewContoller: UIViewController, UITableViewDelegate {
-    lazy var bgView: UIView = .simpleView(color: .hexColor("#222222"))
-
-    lazy var tapArea: UIControl = {
-        let area = UIControl()
-        area.addTarget(self, action: #selector(dismissCurrentVc), for: .touchUpInside)
-        return area
-    }()
-
-    lazy var lineView: UIView = {
-        let line: UIView = .simpleView(color: .white.withAlphaComponent(0.2))
-        line.customCornerRadius = 2
-        return line
-    }()
-
-    lazy var titleLabel: UILabel = .simpleLabel(text: "Up Next".localized(),font: .font(size: 18), color: .white)
-
-    var viewModel: PlayDetailListViewModel = .init()
-
-    lazy var listView: UITableView = {
-        let tabView = UITableView()
-        tabView.dataSource = viewModel
-        tabView.delegate = self
-        tabView.separatorStyle = .none
-        tabView.register(PlayDetailListViewCell
-            .self, forCellReuseIdentifier: "PlayDetailListViewCell")
-        tabView.backgroundColor = .clear
-        return tabView
-    }()
-
-    override func viewDidLoad() {
-        super.viewDidLoad()
-        addChildren()
-        makeConstraints()
-        scrollToCurrentVideo()
-    }
-
-    func addChildren() {
-        view.backgroundColor = .clear
-        view.addSubview(tapArea)
-        view.addSubview(bgView)
-        bgView.addSubview(lineView)
-        bgView.addSubview(titleLabel)
-        bgView.addSubview(listView)
-    }
-
-    func scrollToCurrentVideo() {
-        DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) {
-            if let indexPath = self.viewModel.indexOfCurrentVideo {
-                self.listView.scrollToRow(at: indexPath, at: .middle, animated: false)
-            }
-        }
-    }
-
-
-    @objc func dismissCurrentVc() {
-        dismiss(animated: true)
-    }
-
-   
-    func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
-        let count = viewModel.needRecommend ? viewModel.recommendDatas.count : viewModel.videos.count
-        if indexPath.row < count {
-            if viewModel.needRecommend {
-                let data = viewModel.recommendDatas[indexPath.row]
-                PlayerManager.shared.playVideo(onlineVideo: data, recommendDatas: [], scene: .recommend)
-            } else {
-                let video = viewModel.videos[indexPath.row]
-                PlayerManager.shared.playVideo(video: video,
-                                                    list: viewModel.videos,
-                                                    scene: .local,
-                                                    onceAdKey: "")
-            }
-
-            dismissCurrentVc()
-        }
-    }
-
-    func makeConstraints() {
-        tapArea.snp.makeConstraints { make in
-            make.top.leading.trailing.equalToSuperview()
-            make.bottom.equalTo(bgView.snp.top)
-        }
-        bgView.snp.makeConstraints { make in
-            make.bottom.leading.trailing.equalToSuperview()
-            make.height.equalToSuperview().multipliedBy(0.7)
-        }
-        lineView.snp.makeConstraints { make in
-            make.centerX.equalToSuperview()
-            make.width.equalTo(32)
-            make.height.equalTo(4)
-            make.top.equalToSuperview().offset(8)
-        }
-
-        titleLabel.snp.makeConstraints { make in
-            make.top.equalToSuperview().offset(20)
-            make.leading.equalToSuperview().offset(16)
-        }
-        
-        listView.snp.makeConstraints { make in
-            make.top.equalTo(titleLabel.snp.bottom).offset(20)
-            make.leading.trailing.bottom.equalToSuperview()
-        }
-    }
-
-    override func viewDidLayoutSubviews() {
-        super.viewDidLayoutSubviews()
-        bgView.setRectCorner(corner: [.topLeft, .topRight], radii: CGSize(width: 16, height: 16))
-    }
-}
-
-

+ 0 - 356
TSLiveWallpaper/Business/TSMusic/PlayList/Controller/PlaylistDetailViewController.swift

@@ -1,356 +0,0 @@
-//
-//  PlaylistDetailViewController.swift
-//  ColorfulWallpaper
-//
-//  Created by ni on 2024/9/19.
-//
-
-import Combine
-import Foundation
-import GoogleMobileAds
-import TSVideoKit
-
-class PlaylistDetailViewController: LWBGViewController, UITableViewDelegate {
-    var viewModel: PlayListDetaiViewModel?
-
-    lazy var navBar: LWSubNavigationBar = {
-        let bar = LWSubNavigationBar()
-        bar.backButton.addTarget(self, action: #selector(popupCurrentVc), for: .touchUpInside)
-        return bar
-    }()
-
-    lazy var moreButton: UIButton = {
-        let btn = UIButton()
-        btn.setImage(UIImage(named: "ic_playlist_more"), for: .normal)
-        btn.addTarget(self, action: #selector(moreButtonAction), for: .touchUpInside)
-        return btn
-    }()
-
-    lazy var sortButton: UIButton = {
-        let bt = UIButton(frame: CGRect(x: 0, y: 0, width: 42, height: 42))
-        bt.backgroundColor = UIColor.white.withAlphaComponent(0.1)
-        bt.setImage(.icNavSort, for: .normal)
-        bt.customCornerRadius = 16
-        bt.backgroundColor = .white
-        bt.addTarget(self, action: #selector(showSortOperateView), for: .touchUpInside)
-
-        return bt
-    }()
-
-    lazy var manageButton: UIButton = {
-        let bt = UIButton(frame: CGRect(x: 0, y: 0, width: 42, height: 42))
-        bt.backgroundColor = UIColor.white.withAlphaComponent(0.1)
-        bt.setImage(.icNavManage, for: .normal)
-        bt.customCornerRadius = 16
-        bt.backgroundColor = .white
-        bt.addTarget(self, action: #selector(showManageViewController), for: .touchUpInside)
-        return bt
-    }()
-
-    lazy var emptyView: MusicEmptyView = .init(algin: .center, needButton: false)
-    lazy var filterVc: FilterBarViewController = {
-        let vModel = FilterBarViewModel(videos: viewModel?.videos ?? [], barTyle: .default, selectedVideos: [], sortType: .downTime)
-        vModel.isFromPlaylist = true
-        vModel.playlist = viewModel?.playlist
-        let top = FilterBarViewController(viewModel: vModel)
-        top.needSearch = false
-        top.delegate = self
-        return top
-    }()
-
-    lazy var topView: SongListTopView = {
-        let top = SongListTopView()
-        top.playAllBtn.addTarget(self, action: #selector(playAllButtonAction), for: .touchUpInside)
-        top.shuffleBtn.addTarget(self, action: #selector(shuffleButtonAction), for: .touchUpInside)
-        return top
-    }()
-
-//    lazy var manageView: PlayListManageView = {
-//        let manage = PlayListManageView()
-//        manage.sortButton.addTarget(self, action: #selector(showSortOperateView), for: .touchUpInside)
-//        manage.manageButton.addTarget(self, action: #selector(showManageViewController), for: .touchUpInside)
-//        return manage
-//    }()
-
-    lazy var listView: UITableView = {
-        let tabView = UITableView()
-        tabView.dataSource = viewModel
-        tabView.delegate = self
-        tabView.separatorStyle = .none
-        tabView.register(SongListCell
-            .self, forCellReuseIdentifier: "SongListCell")
-        tabView.backgroundColor = .clear
-        tabView.contentInset = UIEdgeInsets(top: 0, left: 0, bottom: 80, right: 0)
-        return tabView
-    }()
-
-    private var canncellable: [AnyCancellable] = []
-
-    override func viewDidLoad() {
-        super.viewDidLoad()
-
-        bgImageView.image = .viewMainBg
-
-        switch viewModel?.listType {
-        case .favourite:
-            navBar.titleLabel.text = "Like".localized()
-            moreButton.isHidden = true
-            manageButton.isHidden = true
-        case .recently:
-            navBar.titleLabel.text = "Recently".localized()
-            moreButton.isHidden = true
-            manageButton.isHidden = true
-        case .playlist:
-            navBar.titleLabel.text = viewModel?.playlist?.title
-            moreButton.isHidden = false
-            manageButton.isHidden = false
-        case nil:
-            navBar.titleLabel.text = viewModel?.playlist?.title
-            moreButton.isHidden = false
-            manageButton.isHidden = true
-        }
-    }
-
-    convenience init(viewModel: PlayListDetaiViewModel) {
-        self.init()
-        self.viewModel = viewModel
-    }
-
-    override func viewWillAppear(_ animated: Bool) {
-        super.viewWillAppear(true)
-        PlayerManager.shared.rootVc?.moveDownMiniBar()
-        viewModel?.requestData()
-    }
-
-    override func viewWillDisappear(_ animated: Bool) {
-        super.viewWillDisappear(animated)
-        filterVc.viewModel?.doneMutiSelect()
-    }
-
-    override func addNotifaction() {
-        super.addNotifaction()
-        viewModel?.$videos.receive(on: DispatchQueue.main).sink(receiveValue: { [weak self] _ in
-            guard let self = self else {
-                return
-            }
-            self.emptyView.isHidden = self.viewModel?.videos.isEmpty == false
-            self.refreshViews()
-        }).store(in: &canncellable)
-
-        NotificationCenter.default.addObserver(self, selector: #selector(reloadDatas), name: .K_RefreshNotifaction, object: nil)
-        NotificationCenter.default.addObserver(self, selector: #selector(reloadDatas), name: kDataChangedNotifactionName, object: nil)
-    }
-
-    @objc func reloadDatas() {
-        viewModel?.requestData()
-    }
-
-    @objc func moreButtonAction() {
-        // 创建 UIAlertController,样式为 actionSheet
-        let alert = UIAlertController()
-
-        // 添加第一个选项
-        let option1 = UIAlertAction(title: "Rename".localized(), style: .default) { [weak self] _ in
-            guard let self = self else { return }
-            if let mPlaylist = self.viewModel?.playlist {
-                CWOperateViewController.renamePlaylist(playlist: mPlaylist) { name in
-                    self.navBar.titleLabel.text = name
-                }
-            }
-        }
-        alert.addAction(option1)
-
-        // 添加第二个选项
-        let option2 = UIAlertAction(title: "Delete Playlist".localized(), style: .destructive) { [weak self] _ in
-            guard let self = self else { return }
-            if let mPlaylist = self.viewModel?.playlist {
-                CWOperateViewController.deletePlaylist(playlist: mPlaylist) {
-                    self.navigationController?.popViewController(animated: true)
-                }
-            }
-        }
-        alert.addAction(option2)
-
-        // 添加取消按钮
-        let cancelAction = UIAlertAction(title: "Cancel".localized(), style: .cancel, handler: nil)
-        alert.addAction(cancelAction)
-
-        // 弹出弹窗
-        PlayerManager.shared.rootVc?.present(alert, animated: true, completion: nil)
-    }
-
-    @objc func playAllButtonAction() {
-        guard let mViewModel = viewModel else {
-            return
-        }
-        if let firstVideo = mViewModel.videos.first {
-            PlayerManager.shared.player?.playControl.viewModel.loopMode = .cyclic
-            PlayerManager.shared.playVideo(video: firstVideo, list: mViewModel.videos, scene: .local, onceAdKey: "PlaylistDetail_PlayAll")
-            listView.reloadData()
-        }
-    }
-
-    @objc func shuffleButtonAction() {
-        guard let mViewModel = viewModel else {
-            return
-        }
-        if let firstVideo = mViewModel.videos.randomElement() {
-            PlayerManager.shared.player?.playControl.viewModel.loopMode = .random
-            PlayerManager.shared.playVideo(video: firstVideo, list: mViewModel.videos, scene: .local, onceAdKey: "PlaylistDetail_Shuffle")
-            listView.reloadData()
-        }
-    }
-
-    @objc func showSortOperateView() {
-        guard let viewModel = viewModel else {
-            return
-        }
-        let vc = SortMenuViewController(type: viewModel.sortType)
-        vc.modalPresentationStyle = .overFullScreen
-        vc.didSelectedSortType = { type in
-            self.viewModel?.sortType = type
-            self.viewModel?.requestData()
-        }
-        present(vc, animated: true)
-    }
-
-    @objc func showManageViewController() {
-    }
-
-    func refreshViews() {
-        if viewModel?.videos.isEmpty == true {
-            filterVc.view.isHidden = true
-        } else {
-            filterVc.view.isHidden = false
-        }
-        filterVc.viewModel?.selectedVideos = []
-        filterVc.viewModel?.videos = viewModel?.videos ?? []
-        filterVc.updateBarInfo()
-        filterVc.mutiDoneButtonClicked()
-        listView.reloadData()
-        resetViews()
-    }
-
-    override func addChildren() {
-        super.addChildren()
-        addChild(filterVc)
-        view.addSubview(navBar)
-        view.addSubview(filterVc.view)
-        filterVc.didMove(toParent: self)
-
-//        navBar.appendRightItem(item: sortButton)
-//        navBar.appendRightItem(item: manageButton)
-//        navBar.appendRightItem(item: moreButton)
-
-//        view.addSubview(topView)
-        view.addSubview(listView)
-        view.addSubview(emptyView)
-    }
-
-    override func makeConstarints() {
-        super.makeConstarints()
-        navBar.snp.makeConstraints { make in
-            make.height.equalTo(44)
-            make.horizontalEdges.equalToSuperview()
-            make.top.equalTo(view.safeAreaLayoutGuide.snp.top)
-        }
-
-//        topView.snp.makeConstraints { make in
-//            make.horizontalEdges.equalToSuperview().inset(16)
-//            make.top.equalTo(navBar.snp.bottom).offset(16)
-//            make.height.equalTo(44)
-//        }
-        filterVc.view.snp.makeConstraints { make in
-            make.horizontalEdges.equalToSuperview().inset(16)
-            make.top.equalTo(navBar.snp.bottom)
-            make.height.equalTo(40)
-        }
-
-        listView.snp.makeConstraints { make in
-            make.top.equalTo(filterVc.view.snp.bottom).offset(12)
-            make.bottom.leading.trailing.equalToSuperview()
-        }
-        emptyView.snp.makeConstraints { make in
-            make.top.equalTo(navBar.snp.bottom)
-            make.bottom.leading.trailing.equalToSuperview()
-        }
-    }
-
-    func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
-        if let vM = viewModel, indexPath.row < vM.videos.count {
-            let model = vM.videos[indexPath.row]
-            if viewModel?.isMuti == true {
-                vM.addToSelectedList(video: model)
-                filterVc.viewModel?.selectedVideos = vM.selectedVideos
-                listView.reloadData()
-            } else {
-                var key = viewModel?.playlist?.id?.uuidString ?? "DefaultPlaylist"
-                if viewModel?.listType == .favourite {
-                    key = "FavouritePlaylist"
-                }
-                PlayerManager.shared.playVideo(video: model, list: vM.videos, scene: .local, onceAdKey: key)
-            }
-        }
-    }
-
-    deinit {
-        NotificationCenter.default.removeObserver(self)
-
-        canncellable.removeAll()
-    }
-}
-
-extension PlaylistDetailViewController: FilterBarViewControllerDelegate {
-    func selectedAllVideo() {
-        guard let viewModel = viewModel else { return }
-        if filterVc.viewModel?.selectedVideos.count == viewModel.videos.count {
-            viewModel.selectedVideos = []
-        } else {
-            viewModel.selectedVideos = viewModel.videos
-        }
-        filterVc.viewModel?.selectedVideos = viewModel.selectedVideos
-        listView.reloadData()
-    }
-
-    func doneMutiManage() {
-        guard let viewModel = viewModel else { return }
-
-        viewModel.selectedVideos = []
-        filterVc.viewModel?.selectedVideos = viewModel.selectedVideos
-        listView.reloadData()
-    }
-
-    func resetViews() {
-        listView.snp.updateConstraints { make in
-            if viewModel?.isMuti == true {
-                make.bottom.equalToSuperview().offset(-(k_TabBar_Height + 62))
-            } else {
-                make.bottom.equalToSuperview()
-            }
-        }
-        emptyView.snp.updateConstraints { make in
-            if viewModel?.isMuti == true {
-                make.bottom.equalToSuperview().offset(-(k_TabBar_Height + 62))
-            } else {
-                make.bottom.equalToSuperview()
-            }
-        }
-    }
-
-    func localSearchDidClicked() {
-    }
-
-    func topBarTypeDidChange(barType: MineRingTopType) {
-        viewModel?.isMuti = barType == .mutiselect
-        listView.reloadData()
-        resetViews()
-    }
-
-    func sortTypeDidChange(sortType: SortType) {
-        viewModel?.sortType = sortType
-        viewModel?.requestData()
-        if viewModel?.videos.isEmpty == false {
-            listView.scrollToRow(at: .init(row: 0, section: 0), at: .top, animated: false)
-        }
-    }
-}

+ 0 - 32
TSLiveWallpaper/Business/TSMusic/PlayList/Controller/PlaylistViewController+Ext.swift

@@ -1,32 +0,0 @@
-//
-//  PlaylistViewController+Ext.swift
-//  TSLiveWallpaper
-//
-//  Created by nkl on 2024/12/26.
-//
-
-import Foundation
-import TSVideoKit
-// import ADManager
-
-extension PlaylistViewController {
-    @objc func showRecentlyList() {
-        let vModel: PlayListDetaiViewModel = .init()
-        vModel.listType = .recently
-        let vc = PlaylistDetailViewController(viewModel: vModel)
-        vc.hidesBottomBarWhenPushed = true
-        navigationController?.pushViewController(vc, animated: true)
-    }
-
-    @objc func showLikeViewController() {
-        //        ADManager.shared.showAd(scene: ADScene.playlist, from: self) { state in
-        //            if state == .finished || state == .fail {
-        let vModel: PlayListDetaiViewModel = .init()
-        vModel.listType = .favourite
-        let vc = PlaylistDetailViewController(viewModel: vModel)
-        vc.hidesBottomBarWhenPushed = true
-        navigationController?.pushViewController(vc, animated: true)
-        //            }
-        //        }
-    }
-}

+ 0 - 133
TSLiveWallpaper/Business/TSMusic/PlayList/Controller/PlaylistViewController.swift

@@ -1,133 +0,0 @@
-//
-//  PlaylistViewController.swift
-//  ColorfulWallpaper
-//
-//  Created by ni on 2024/9/18.
-//
-
-import ADManager
-import Combine
-import Foundation
-import TSVideoKit
-
-class PlaylistViewController: LWBGViewController, UITableViewDelegate {
-    var viewModel: PlayListViewModel = .init()
-
-    lazy var listView: UITableView = {
-        let tabView = UITableView()
-        tabView.dataSource = viewModel
-        tabView.delegate = self
-        tabView.separatorStyle = .none
-        tabView.register(PlayListCell
-            .self, forCellReuseIdentifier: "PlayListCell")
-        tabView.register(PlayListAddCell.self, forCellReuseIdentifier: "PlayListAddCell")
-        tabView.register(PlayListFavouriteCell.self, forCellReuseIdentifier: "PlayListFavouriteCell")
-        tabView.backgroundColor = .clear
-        tabView.contentInset = UIEdgeInsets(top: 0, left: 0, bottom: 80, right: 0)
-        return tabView
-    }()
-
-    private var canncellable: [AnyCancellable] = []
-
-    override func viewDidLoad() {
-        super.viewDidLoad()
-        bgImageView.image = nil
-        navigationController?.navigationBar.isHidden = true
-        addNotifaction()
-    }
-
-    override func viewWillAppear(_ animated: Bool) {
-        super.viewWillAppear(animated)
-        PlayerManager.shared.miniBar.isHidden = false
-        PlayerManager.shared.rootVc?.moveUpMiniBar()
-        viewModel.requestData()
-    }
-
-    override func viewDidDisappear(_ animated: Bool) {
-        super.viewDidDisappear(animated)
-    }
-
-    override func addNotifaction() {
-        super.addNotifaction()
-
-        viewModel.$playLists.receive(on: DispatchQueue.main).sink { _ in
-            self.reloadListData()
-        }.store(in: &canncellable)
-
-        NotificationCenter.default.addObserver(self, selector: #selector(reloadData), name: .K_RefreshNotifaction, object: nil)
-        NotificationCenter.default.addObserver(self, selector: #selector(reloadData), name: kDataChangedNotifactionName, object: nil)
-    }
-
-    @objc func reloadData() {
-        viewModel.requestData()
-    }
-
-    func reloadListData() {
-        listView.reloadData()
-    }
-
-    func newPlaylist() {
-        let alertVC = UIAlertController(title: nil, message: "Playlist Name".localized(), preferredStyle: .alert)
-        alertVC.addTextField { textField in
-            textField.placeholder = "input name".localized()
-            textField.font = UIFont.systemFont(ofSize: 16)
-        }
-        let ok = UIAlertAction(title: "OK".localized(), style: .default) { [weak self] _ in
-            if let name = alertVC.textFields?.first?.text, !name.isEmpty {
-                self?.viewModel.creatPlayList(name: name) { listid in
-                    if let id = listid {
-                        self?.didFinishedCreatedPlaylist(id: id)
-                    }
-                }
-            }
-        }
-        let cancel = UIAlertAction(title: "Cancel".localized(), style: .cancel)
-        alertVC.addAction(cancel)
-        alertVC.addAction(ok)
-        present(alertVC, animated: true)
-    }
-
-    func didFinishedCreatedPlaylist(id: UUID) {
-    }
-
-    override func addChildren() {
-        super.addChildren()
-        view.addSubview(listView)
-    }
-
-    override func makeConstarints() {
-        super.makeConstarints()
-
-        listView.snp.makeConstraints { make in
-            make.top.equalToSuperview()
-            make.bottom.leading.trailing.equalToSuperview()
-        }
-    }
-
-    func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
-        if indexPath.section == 0 {
-            newPlaylist()
-        } else if indexPath.section == 1 {
-            showLikeViewController()
-        } else {
-            ADManager.shared.showAd(scene: ADScene.playlist, from: self) { state in
-                if state == .finished || state == .fail {
-                    if indexPath.row < self.viewModel.playLists.count {
-                        let list = self.viewModel.playLists[indexPath.row]
-                        let vModel: PlayListDetaiViewModel = .init()
-                        vModel.playlist = list
-                        vModel.listType = .playlist
-                        let vc = PlaylistDetailViewController(viewModel: vModel)
-                        vc.hidesBottomBarWhenPushed = true
-                        self.navigationController?.pushViewController(vc, animated: true)
-                    }
-                }
-            }
-        }
-    }
-
-    deinit {
-        NotificationCenter.default.removeObserver(self)
-        canncellable.removeAll()
-    }
-}

+ 0 - 72
TSLiveWallpaper/Business/TSMusic/PlayList/ViewModel/AddPlayListViewModel.swift

@@ -1,72 +0,0 @@
-//
-//  AddPlayListViewModel.swift
-//  ColorfulWallpaper
-//
-//  Created by ni on 2024/9/19.
-//
-
-import Foundation
-import TSVideoKit
-import KLTips
-
-class AddPlayListViewModel : NSObject {
-    @Published var playLists: [TSPlayList] = []
-    var needMore: Bool = true
-
-    func requestData() {
-        playLists = TSVideoOperator.shared.dataManager.fetchPlaylists()
-        print("data====\(playLists.count)")
-    }
-
-    func reloadData() {
-        requestData()
-    }
-
-    func creatPlayList(name: String, complete: (UUID?) -> Void) {
-        TSVideoOperator.shared.dataManager.createPlaylist(name: name) { playlistId in
-
-            if let id = playlistId {
-                reloadData()
-                THUD.toast("Created Successfully".localized())
-                NotificationCenter.default.post(name: .K_RefreshNotifaction, object: nil)
-                complete(id)
-            } else {
-                complete(nil)
-            }
-        }
-    }
-}
-
-extension AddPlayListViewModel: UITableViewDataSource {
-    
-    func numberOfSections(in tableView: UITableView) -> Int {
-        return 2
-    }
-    
-    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
-        if section == 0 {
-            return 1
-        } else {
-            return playLists.count
-        }
-    }
-
-    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
-        if indexPath.section == 0 {
-            if let cell = tableView.dequeueReusableCell(withIdentifier: "PlayListCell") as? PlayListAddCell {
-                return cell
-            }
-            return PlayListAddCell()
-        }else{
-            if let cell = tableView.dequeueReusableCell(withIdentifier: "PlayListCell") as? PlayListCell {
-                if indexPath.row < playLists.count {
-                    let playList = playLists[indexPath.row]
-                    cell.bindData(list: playList, needMoreButton: needMore)
-                }
-                return cell
-            }
-            return PlayListCell()
-        }
-  
-    }
-}

+ 0 - 77
TSLiveWallpaper/Business/TSMusic/PlayList/ViewModel/PlayDetailListViewModel.swift

@@ -1,77 +0,0 @@
-//
-//  PlayDetaiListViewModel.swift
-//  ColorfulWallpaper
-//
-//  Created by ni on 2024/9/19.
-//
-
-import Foundation
-import TSVideoKit
-import UIKit
-
-class PlayDetailListViewModel: NSObject, UITableViewDataSource {
-    var playScene: TSPlayScene = .local
-    var videos: [TSVideo] = []
-    var recommendDatas: [VideoOnlineModel] = []
-    var needRecommend: Bool {
-        return playScene == .recommend || playScene == .online
-    }
-
-    var indexOfCurrentVideo: IndexPath? {
-        if needRecommend {
-            if let index = recommendDatas.firstIndex(where: { video in
-                video.videoId == PlayerManager.shared.currentVideo?.videoId
-            }) {
-                return IndexPath(row: index, section: 0)
-            }
-            return nil
-        } else {
-            if let index = videos.firstIndex(where: { video in
-                video.videoId == PlayerManager.shared.currentVideo?.videoId
-            }) {
-                return IndexPath(row: index, section: 0)
-            }
-            return nil
-        }
-    }
-
-    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
-        needRecommend ? recommendDatas.count : videos.count
-    }
-
-    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
-        guard let cell = tableView.dequeueReusableCell(withIdentifier: "PlayDetailListViewCell") as? PlayDetailListViewCell else {
-            return SongListCell()
-        }
-
-        let dataCount = needRecommend ? recommendDatas.count : videos.count
-
-        if indexPath.row < dataCount {
-            if needRecommend {
-                cell.bindData(data: recommendDatas[indexPath.row])
-            } else {
-                cell.bindData(video: videos[indexPath.row])
-            }
-
-            cell.deleteButtonClickEvent = { videoId in
-
-                if TSVideoOperator.shared.playerViewModel.currentVideo?.videoId == videoId {
-                    TSVideoOperator.shared.playerController.playNext()
-                }
-                // 删除视频数据
-                if TSVideoOperator.shared.playerViewModel.scene == .online || TSVideoOperator.shared.playerViewModel.scene == .recommend  {
-                    TSVideoOperator.shared.playerViewModel.recommendDatas.removeAll { model in
-                        model.videoId == videoId
-                    }
-                    self.recommendDatas.removeAll { $0.videoId == videoId }
-                } else {
-                    TSVideoOperator.shared.playerViewModel.currentVideos.removeAll { $0.videoId == videoId }
-                    self.videos.removeAll { $0.videoId == videoId }
-                }
-                tableView.reloadData()
-            }
-        }
-
-        return cell
-    }
-}

+ 0 - 88
TSLiveWallpaper/Business/TSMusic/PlayList/ViewModel/PlayListDetaiViewModel.swift

@@ -1,88 +0,0 @@
-//
-//  PlayListDetaiViewModel.swift
-//  ColorfulWallpaper
-//
-//  Created by ni on 2024/9/19.
-//
-
-import Combine
-import Foundation
-import TSVideoKit
-
-enum ListType {
-    case favourite
-    case recently
-    case playlist
-}
-
-class PlayListDetaiViewModel: NSObject, UITableViewDataSource {
-    var selectedVideos: [TSVideo] = []
-    var isMuti: Bool = false
-    var sortType: SortType = .downTime
-    var playlist: TSPlayList?
-//    var isFavourite : Bool = false
-    var listType: ListType = .playlist
-    @Published var selectedSingle: TSVideo?
-
-    @Published var videos: [TSVideo] = []
-
-    func requestData() {
-        var mVideos: [TSVideo] = []
-
-        switch listType {
-        case .favourite:
-            mVideos = TSVideoOperator.shared.dataManager.fetchFavouriteVideos(sort: NSSortDescriptor(key: "liketime", ascending: false))
-        case .recently:
-            mVideos = TSVideoOperator.shared.dataManager.fetchHistoryVideos()
-        case .playlist:
-            if let playlist = playlist {
-                mVideos = TSVideoOperator.shared.dataManager.fetchPlaylistDetail(playlist: playlist)
-            }
-        }
-
-        if sortType == .downTime {
-            videos = mVideos
-        } else if sortType == .upTime {
-            videos = mVideos.reversed()
-        } else if sortType == .downName {
-            videos = mVideos.sorted {
-                $0.title ?? "" < $1.title ?? ""
-            }
-        } else if sortType == .upName {
-            videos = mVideos.sorted {
-                $0.title ?? "" > $1.title ?? ""
-            }
-        }
-    }
-
-    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
-        return videos.count
-    }
-
-    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
-        let cell = tableView.dequeueReusableCell(withIdentifier: "SongListCell") as! SongListCell
-        if indexPath.row < videos.count {
-            let video = videos[indexPath.row]
-            cell.mPlaylist = playlist
-            cell.bindData(video: video, isMutiSelected: isMuti, isSelected: selectedVideos.contains(where: {
-                $0.videoId == video.videoId
-            }),needOperate: listType != .recently)
-        }
-        return cell
-    }
-    
-    /// 加入选中列表
-    /// - Parameter video: video
-    func addToSelectedList(video: TSVideo) {
-        // 已经有了,那么删除
-        if selectedVideos.contains(where: {
-            $0.videoId == video.videoId
-        }) {
-            selectedVideos.removeAll(where: {
-                $0.videoId == video.videoId
-            })
-        } else {
-            selectedVideos.append(video)
-        }
-    }
-}

+ 0 - 84
TSLiveWallpaper/Business/TSMusic/PlayList/ViewModel/PlayListViewModel.swift

@@ -1,84 +0,0 @@
-//
-//  PlayListViewModel.swift
-//  ColorfulWallpaper
-//
-//  Created by ni on 2024/9/18.
-//
-
-import CoreData
-import Foundation
-import KLTips
-import TSVideoKit
-import UIKit
-
-class PlayListViewModel: NSObject {
-    @Published var playLists: [TSPlayList] = []
-    var needMore: Bool = true
-
-    var recentlyCount: Int = 0
-    var likeCount: Int = 0
-
-    func requestData() {
-        playLists = TSVideoOperator.shared.dataManager.fetchPlaylists()
-        recentlyCount = TSVideoOperator.shared.dataManager.fetchHistoryVideos().count
-        likeCount = TSVideoOperator.shared.dataManager.fetchFavouriteVideos(sort: NSSortDescriptor(key: "createdAt", ascending: true)).count
-    }
-
-    func reloadData() {
-        requestData()
-    }
-
-    func creatPlayList(name: String, complete: (UUID?) -> Void) {
-        TSVideoOperator.shared.dataManager.createPlaylist(name: name) { playlistId in
-
-            if let id = playlistId {
-                reloadData()
-                THUD.toast("Created Successfully".localized())
-                NotificationCenter.default.post(name: .K_RefreshNotifaction, object: nil)
-                complete(id)
-            } else {
-                complete(nil)
-            }
-        }
-    }
-}
-
-extension PlayListViewModel: UITableViewDataSource {
-    func numberOfSections(in tableView: UITableView) -> Int {
-        return 3
-    }
-
-    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
-        if section == 0 {
-            return 1
-        } else if section == 1 {
-            return 1
-        } else {
-            return playLists.count
-        }
-    }
-
-    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
-        if indexPath.section == 0 {
-            if let cell = tableView.dequeueReusableCell(withIdentifier: "PlayListCell") as? PlayListAddCell {
-                return cell
-            }
-            return PlayListAddCell()
-        } else if indexPath.section == 1 {
-            if let cell = tableView.dequeueReusableCell(withIdentifier: "PlayListFavouriteCell") as? PlayListFavouriteCell {
-                cell.updateCount(count: likeCount)
-                return cell
-            }
-            return PlayListFavouriteCell()
-        } else {
-            if let cell = tableView.dequeueReusableCell(withIdentifier: "PlayListCell") as? PlayListCell {
-                if indexPath.row < playLists.count {
-                    let playList = playLists[indexPath.row]
-                    cell.bindData(list: playList, needMoreButton: needMore)
-                }
-                return cell
-            }
-            return PlayListCell()
-        }
-    }
-}

+ 0 - 145
TSLiveWallpaper/Business/TSMusic/PlayList/ViewModel/SongListManageViewModel.swift

@@ -1,145 +0,0 @@
-//
-//  SongListManageViewModel.swift
-//  TSLiveWallpaper
-//
-//  Created by nkl on 2024/12/24.
-//
-
-import Foundation
-import TSVideoKit
-
-class SongListManageViewModel: NSObject, UITableViewDataSource {
-    var videos: [TSVideo] = []
-    var playlist: TSPlayList?
-    @Published var selectedVideos: [TSVideo] = []
-
-    var isSelectedAll: Bool {
-        selectedVideos.count == videos.count
-    }
-
-    var selectedTitle: String {
-        "Select (\(selectedVideos.count)/\(videos.count))"
-    }
-
-    func numberOfSections(in tableView: UITableView) -> Int {
-        return 1
-    }
-
-    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
-        return videos.count
-    }
-
-    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
-        if let cell = tableView.dequeueReusableCell(withIdentifier: "SongListCell") as? SongListCell {
-            if indexPath.row < videos.count {
-                let videoModel = videos[indexPath.row]
-                let isSelected = selectedVideos.contains(where: {
-                    $0.videoId == videoModel.videoId
-                })
-                cell.bindData(video: videoModel, isMutiSelected: true, isSelected: isSelected, needOperate: false)
-            }
-            return cell
-        }
-        return SongListCell()
-    }
-
-    func deleteSelectedVideos(parent: UIViewController, complete: @escaping () -> Void) {
-        if selectedVideos.isEmpty {
-            return
-        }
-
-        let ac = UIAlertController(title: nil,
-                                   message: "Are you sure to delete".localized(), preferredStyle: .alert)
-        ac.addAction(UIAlertAction(title: "Cancel".localized(), style: .cancel))
-        ac.addAction(UIAlertAction(title: "Delete".localized(), style: .destructive, handler: { _ in
-
-            /// 删除当前歌曲
-            if self.selectedVideos.contains(where: {
-                $0.videoId == TSVideoOperator.shared.playerViewModel.currentVideo?.videoId
-            }) {
-                TSVideoOperator.shared.playerController.player.stop()
-                TSVideoOperator.shared.playerViewModel.currentVideo = nil
-            }
-
-            /// 删除播放列表歌曲
-            let videoIds: [String] = self.selectedVideos.compactMap {
-                $0.videoId
-            }
-            let needRestart = videoIds.contains { id in
-                id == TSVideoOperator.shared.playerViewModel.currentVideo?.videoId
-            }
-            TSVideoOperator.shared.dataManager.deleteVideos(videos: self.selectedVideos) { _ in
-
-                PlayerManager.shared.hideMutiOperateView()
-
-                for item in videoIds {
-                    TSVideoOperator.shared.playerViewModel.currentVideos.removeAll { $0.isFault }
-                    self.videos.removeAll {
-                        $0.videoId == item
-                    }
-                }
-
-                // 播放删完列表后的第一首
-                let newVideos = TSVideoOperator.shared.playerViewModel.currentVideos
-                if let video = newVideos.first {
-                    if needRestart {
-                        /// 播放的时候回刷新列表不用重复刷
-                        TSVideoOperator.shared.playerController.playVideo(video: video, list: newVideos, scene: .local)
-                    }
-                    /// 发送刷新通知
-                    NotificationCenter.default.post(name: .K_RefreshNotifaction, object: nil)
-                } else {
-                    /// 发送刷新通知
-                    NotificationCenter.default.post(name: .K_RefreshNotifaction, object: nil)
-                }
-                complete()
-            }
-
-        }))
-
-        parent.present(ac, animated: true)
-    }
-
-    func selectAllVideos() {
-        selectedVideos = videos
-    }
-
-    func deSelectAllVideos() {
-        selectedVideos.removeAll()
-    }
-
-    func removeSelectedFromPlaylist(playlist: TSPlayList, complete: @escaping () -> Void) {
-        if selectedVideos.isEmpty {
-            return
-        }
-        TSVideoOperator.shared.dataManager.removeVideosFromPlaylist(videos: selectedVideos, from: playlist) { _ in
-            complete()
-        }
-    }
-
-    func addSelectedToPlaylist(parent: UIViewController, complete: @escaping () -> Void) {
-        if selectedVideos.isEmpty {
-            return
-        }
-        let vc = AddPlayListViewController(videos: selectedVideos)
-        vc.addSuccessBlock = {
-            complete()
-        }
-        parent.present(vc, animated: true)
-    }
-
-    /// 加入选中列表
-    /// - Parameter video: video
-    func addToSelectedList(video: TSVideo) {
-        // 已经有了,那么删除
-        if selectedVideos.contains(where: {
-            $0.videoId == video.videoId
-        }) {
-            selectedVideos.removeAll(where: {
-                $0.videoId == video.videoId
-            })
-        } else {
-            selectedVideos.append(video)
-        }
-    }
-}

+ 0 - 131
TSLiveWallpaper/Business/TSMusic/PlayList/Views/PlayDetailListViewCell.swift

@@ -1,131 +0,0 @@
-//
-//  PlayDetaiListViewCell.swift
-//  ColorfulWallpaper
-//
-//  Created by ni on 2024/9/19.
-//
-
-import Foundation
-import TSVideoKit
-import UIKit
-
-class PlayDetailListViewCell: UITableViewCell {
-    var deleteButtonClickEvent: (String) -> Void = { _ in }
-
-    lazy var bgView: UIView = .simpleView(color: .clear)
-
-    lazy var iconView: UIImageView = {
-        let img: UIImageView = .init(image: UIImage(named: ""))
-        img.customCornerRadius = 12
-        img.contentMode = .scaleAspectFill
-        return img
-    }()
-
-    lazy var titleLabel: UILabel = .simpleLabel(text: "", font: .systemFont14, color: .white)
-    lazy var detailLabel: UILabel = .simpleLabel(text: "", font: .systemFont14, color: .white.withAlphaComponent(0.4))
-    lazy var stackView: UIStackView = {
-        let stack: UIStackView = .vStack
-        stack.spacing = 8
-        return stack
-    }()
-
-    lazy var hStackView: UIStackView = {
-        let stack: UIStackView = .hStack
-        stack.spacing = 8
-        stack.alignment = .center
-        return stack
-    }()
-
-    lazy var playingTag: UIImageView = .simpleImage(imageName: "ic_playing_tag")
-
-    lazy var deleteButton: UIButton = {
-        let btn = UIButton()
-        btn.setImage(.init(named: "ic-close"), for: .normal)
-        btn.addTarget(self, action: #selector(deleteButtonAction), for: .touchUpInside)
-        return btn
-    }()
-
-    private var videoId: String = ""
-
-    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
-        super.init(style: style, reuseIdentifier: reuseIdentifier)
-        backgroundColor = .clear
-        selectionStyle = .none
-        addChildren()
-        makeConstraints()
-    }
-
-    func bindData(video: TSVideo) {
-        videoId = video.videoId ?? ""
-        titleLabel.text = video.title
-        detailLabel.text = video.artist
-        let isPlaying = video.videoId == PlayerManager.shared.currentVideo?.videoId
-        titleLabel.textColor = isPlaying ? .hexColor("#60FFD2") : .white
-        detailLabel.textColor = isPlaying ? .hexColor("#60FFD2").withAlphaComponent(0.4) : .white.withAlphaComponent(0.4)
-
-        if video.isOnline {
-            iconView.kf.setImage(with: video.iconUrl)
-        } else {
-            if let imgData = video.artwork {
-                iconView.image = UIImage(data: imgData)
-            } else {
-                iconView.image = UIImage(named: "ic_default")
-            }
-        }
-    }
-
-    func bindData(data: VideoOnlineModel) {
-        videoId = data.videoId
-        titleLabel.text = data.title
-        detailLabel.text = data.channelName
-        let isPlaying = data.videoId == PlayerManager.shared.currentVideo?.videoId
-        playingTag.isHidden = !isPlaying
-        iconView.kf.setImage(with: data.iconUrl)
-    }
-
-    @objc func deleteButtonAction() {
-        deleteButtonClickEvent(videoId)
-    }
-
-    required init?(coder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-
-    func addChildren() {
-        contentView.addSubview(bgView)
-        bgView.addSubview(hStackView)
-        hStackView.addArrangedSubview(iconView)
-        hStackView.addArrangedSubview(stackView)
-        hStackView.addArrangedSubview(playingTag)
-        stackView.addArrangedSubview(titleLabel)
-        stackView.addArrangedSubview(detailLabel)
-        bgView.addSubview(deleteButton)
-    }
-
-    func makeConstraints() {
-        bgView.snp.makeConstraints { make in
-            make.horizontalEdges.equalToSuperview()
-            make.verticalEdges.equalToSuperview().inset(8)
-        }
-
-        hStackView.snp.makeConstraints { make in
-            make.leading.equalToSuperview().inset(16)
-            make.trailing.equalTo(deleteButton.snp.leading).offset(-8)
-            make.verticalEdges.equalToSuperview()
-        }
-
-        iconView.snp.makeConstraints { make in
-            make.width.height.equalTo(60)
-        }
-
-        playingTag.snp.makeConstraints { make in
-            make.width.height.equalTo(24)
-        }
-
-        deleteButton.snp.makeConstraints { make in
-            make.trailing.equalToSuperview().offset(-16)
-            make.centerY.equalToSuperview()
-            make.width.height.equalTo(18)
-        }
-    }
-}

+ 0 - 57
TSLiveWallpaper/Business/TSMusic/PlayList/Views/PlayListAddCell.swift

@@ -1,57 +0,0 @@
-//
-//  PlayListAddCell.swift
-//  ColorfulWallpaper
-//
-//  Created by ni on 2024/9/19.
-//
-
-import Foundation
-import TSVideoKit
-import UIKit
-
-class PlayListAddCell: UITableViewCell {
-    lazy var iconView: UIImageView = .simpleImage(imageName: "ic_addplaylist")
-    lazy var titleLabel: UILabel = .simpleLabel(text: "Create Playlist".localized(), font: .systemFont16, color: .white)
-
-    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
-        super.init(style: style, reuseIdentifier: reuseIdentifier)
-        backgroundColor = .clear
-        selectionStyle = .none
-        addChildren()
-        makeConstraint()
-    }
-
-    func addChildren() {
-        addSubview(iconView)
-        addSubview(titleLabel)
-    }
-
-    func makeConstraint() {
-        iconView.snp.makeConstraints { make in
-            make.leading.equalToSuperview().offset(16)
-            make.width.height.equalTo(56)
-            make.top.equalToSuperview().offset(12)
-            make.bottom.equalToSuperview().offset(-12)
-        }
-
-        titleLabel.snp.makeConstraints { make in
-            make.leading.equalTo(iconView.snp.trailing).offset(12)
-            make.trailing.equalToSuperview().offset(-16)
-            make.centerY.equalToSuperview()
-        }
-    }
-
-    required init?(coder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-}
-
-class PlayListFavouriteCell: PlayListCell {
-    func updateCount(count: Int = 0) {
-        moreButton.isHidden = true
-        iconView.image = UIImage(named: "ic_playlist_like")
-        titleLabel.text = "Like".localized()
-        titleLabel.textColor = .white
-        countLabel.text = "\(count)"
-    }
-}

+ 0 - 134
TSLiveWallpaper/Business/TSMusic/PlayList/Views/PlayListCell.swift

@@ -1,134 +0,0 @@
-//
-//  PlayListCell.swift
-//  ColorfulWallpaper
-//
-//  Created by ni on 2024/9/18.
-//
-
-import Foundation
-import TSVideoKit
-import UIKit
-
-class PlayListCell: UITableViewCell {
-    lazy var bgView: UIView = {
-        let v: UIView = .simpleView(color: .clear)
-        return v
-    }()
-
-    lazy var iconView: UIImageView = {
-        let img: UIImageView = .init(image: .icDefault)
-        img.customCornerRadius = 8
-        img.contentMode = .scaleAspectFill
-        return img
-    }()
-
-    lazy var titleLabel: UILabel = .simpleLabel(text: "", color: .white)
-    lazy var countLabel: UILabel = .simpleLabel(text: "0", color: .white.withAlphaComponent(0.4))
-
-    lazy var moreButton: UIButton = {
-        let btn = UIButton()
-        btn.setImage(UIImage(named: "icon_more"), for: .normal)
-        btn.addTarget(self, action: #selector(showMoreViewController), for: .touchUpInside)
-        return btn
-    }()
-
-    private var playlist: TSPlayList?
-
-    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
-        super.init(style: style, reuseIdentifier: reuseIdentifier)
-        backgroundColor = .clear
-        selectionStyle = .none
-        addChildren()
-        makeConstraints()
-    }
-
-    @objc func showMoreViewController() {
-        // 创建 UIAlertController,样式为 actionSheet
-        let alert = UIAlertController()
-
-        // 添加第一个选项
-        let option1 = UIAlertAction(title: "Rename".localized(), style: .default) { [weak self] _ in
-            guard let self = self else { return }
-            if let mPlaylist = self.playlist {
-                CWOperateViewController.renamePlaylist(playlist: mPlaylist)
-            }
-        }
-        alert.addAction(option1)
-
-        // 添加第二个选项
-        let option2 = UIAlertAction(title: "Delete Playlist".localized(), style: .destructive) { [weak self] _ in
-            guard let self = self else { return }
-            if let mPlaylist = self.playlist {
-                CWOperateViewController.deletePlaylist(playlist: mPlaylist)
-            }
-        }
-        alert.addAction(option2)
-
-        // 添加取消按钮
-        let cancelAction = UIAlertAction(title: "Cancel".localized(), style: .cancel, handler: nil)
-        alert.addAction(cancelAction)
-
-        // 弹出弹窗
-        PlayerManager.shared.rootVc?.present(alert, animated: true)
-    }
-
-    func bindData(list: TSPlayList, needMoreButton: Bool) {
-        moreButton.isHidden = !needMoreButton
-        playlist = list
-        titleLabel.text = list.title
-        countLabel.text = "\(list.videos?.count ?? 0)"
-        if let firstVideo = list.firstVideo, firstVideo.isOnline == true {
-            if firstVideo.isAudio,!firstVideo.isOnline {
-                iconView.image = .icDefault
-            } else {
-                iconView.kf.setImage(with: firstVideo.iconUrl,placeholder: UIImage.init(named: "ic_default"))
-            }
-        } else {
-            iconView.image = list.artworkImage ?? .icDefault
-        }
-    }
-
-    required init?(coder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-
-    func addChildren() {
-        contentView.addSubview(bgView)
-        bgView.addSubview(iconView)
-        bgView.addSubview(titleLabel)
-        bgView.addSubview(countLabel)
-        bgView.addSubview(moreButton)
-    }
-
-    func makeConstraints() {
-        bgView.snp.makeConstraints { make in
-            make.horizontalEdges.equalToSuperview()
-            make.verticalEdges.equalToSuperview()
-        }
-
-        iconView.snp.makeConstraints { make in
-            make.top.equalToSuperview().offset(12)
-            make.bottom.equalToSuperview().offset(-12)
-            make.leading.equalToSuperview().offset(16)
-            make.width.height.equalTo(56)
-        }
-
-        titleLabel.snp.makeConstraints { make in
-            make.leading.equalTo(iconView.snp.trailing).offset(12)
-            make.trailing.equalTo(moreButton.snp.leading).offset(-12)
-            make.top.equalToSuperview().offset(20)
-        }
-
-        countLabel.snp.makeConstraints { make in
-            make.leading.equalTo(iconView.snp.trailing).offset(12)
-            make.trailing.equalTo(moreButton.snp.leading).offset(-12)
-            make.bottom.equalToSuperview().offset(-20)
-        }
-
-        moreButton.snp.makeConstraints { make in
-            make.trailing.equalToSuperview()
-            make.centerY.equalToSuperview()
-            make.width.height.equalTo(64)
-        }
-    }
-}

+ 0 - 74
TSLiveWallpaper/Business/TSMusic/PlayList/Views/PlayListManageView.swift

@@ -1,74 +0,0 @@
-//
-//  PlayListManageView.swift
-//  TSLiveWallpaper
-//
-//  Created by nkl on 2024/12/26.
-//
-
-import Foundation
-
-class PlayListManageView: UIView {
-    lazy var titleLabel: UILabel = .simpleLabel(text: "", font: .font(size: 18), color: .black)
-    lazy var hStack: UIStackView = {
-        let mStack = UIStackView()
-        mStack.axis = .horizontal
-        mStack.spacing = 12
-        return mStack
-    }()
-
-    lazy var sortButton: UIButton = {
-        let bt = UIButton(frame: CGRect(x: 0, y: 0, width: 42, height: 42))
-        bt.backgroundColor = UIColor.white.withAlphaComponent(0.1)
-        bt.setImage(.icNavSort, for: .normal)
-        bt.customCornerRadius = 20
-        bt.backgroundColor = .white
-        return bt
-    }()
-
-    lazy var manageButton: UIButton = {
-        let bt = UIButton(frame: CGRect(x: 0, y: 0, width: 42, height: 42))
-        bt.backgroundColor = UIColor.white.withAlphaComponent(0.1)
-        bt.setImage(.icNavManage, for: .normal)
-        bt.customCornerRadius = 20
-        bt.backgroundColor = .white
-        return bt
-    }()
-
-    override init(frame: CGRect) {
-        super.init(frame: frame)
-        addChildren()
-        makeConstraints()
-    }
-
-    func addChildren() {
-        addSubview(titleLabel)
-        addSubview(hStack)
-        hStack.addArrangedSubview(sortButton)
-        hStack.addArrangedSubview(manageButton)
-    }
-
-    func makeConstraints() {
-        titleLabel.snp.makeConstraints { make in
-            make.leading.equalToSuperview().offset(16)
-            make.centerY.equalToSuperview()
-            make.trailing.equalTo(hStack.snp.leading).offset(-12)
-        }
-
-        hStack.snp.makeConstraints { make in
-            make.trailing.equalToSuperview().offset(-16)
-            make.centerY.equalToSuperview()
-        }
-        
-        sortButton.snp.makeConstraints { make in
-            make.width.height.equalTo(36)
-        }
-        
-        manageButton.snp.makeConstraints { make in
-            make.width.height.equalTo(36)
-        }
-    }
-
-    required init?(coder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-}

+ 0 - 43
TSLiveWallpaper/Business/TSMusic/PlayList/Views/PlayListTopItemView.swift

@@ -1,43 +0,0 @@
-//
-//  PlayListTopItemView.swift
-//  TSLiveWallpaper
-//
-//  Created by nkl on 2024/12/26.
-//
-
-import Foundation
-
-class PlayListTopItemView: UIControl {
-    lazy var bgImageView: UIImageView = .simpleImage(imageName: "")
-    lazy var vStack: UIStackView = .vStack
-    lazy var titleLabel: UILabel = .simpleLabel(text: "--", font: .font(size: 18))
-    lazy var countLabel: UILabel = .simpleLabel(text: "--", font: .font(size: 18))
-
-    override init(frame: CGRect) {
-        super.init(frame: frame)
-        addChildren()
-        makeConstraints()
-    }
-
-    func addChildren() {
-        addSubview(bgImageView)
-        bgImageView.addSubview(vStack)
-        vStack.addArrangedSubview(titleLabel)
-        vStack.addArrangedSubview(countLabel)
-    }
-
-    func makeConstraints() {
-        bgImageView.snp.makeConstraints { make in
-            make.edges.equalToSuperview()
-        }
-
-        vStack.snp.makeConstraints { make in
-            make.horizontalEdges.equalToSuperview().inset(12)
-            make.verticalEdges.equalToSuperview().inset(12)
-        }
-    }
-
-    required init?(coder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-}

+ 0 - 71
TSLiveWallpaper/Business/TSMusic/PlayList/Views/SongListBottomView.swift

@@ -1,71 +0,0 @@
-//
-//  SongListBottomView.swift
-//  TSLiveWallpaper
-//
-//  Created by nkl on 2024/12/24.
-//
-
-import Foundation
-import UIKit
-
-class SongListBottomView: UIView {
-    lazy var deleteView: ImageTextControl = {
-        let delete = ImageTextControl()
-        delete.configure(image: .icDelete, text: "Delete".localized())
-        return delete
-    }()
-
-    lazy var addToPlaylist: ImageTextControl = {
-        let delete = ImageTextControl()
-        delete.configure(image: .icAddPlaylist, text: "Add to Playlist".localized())
-        return delete
-    }()
-
-    lazy var removeFromPlaylist: ImageTextControl = {
-        let delete = ImageTextControl()
-        delete.configure(image: .icRemovePlaylist, text: "Remove from playlist".localized())
-        return delete
-    }()
-
-    lazy var hStack: UIStackView = {
-        let stk = UIStackView.hStack
-        stk.distribution = .fillEqually
-        return stk
-    }()
-
-    override init(frame: CGRect) {
-        super.init(frame: frame)
-        addChildren()
-        makeConstraints()
-    }
-
-    var isPlaylist: Bool = false {
-        didSet {
-            removeFromPlaylist.isHidden = !isPlaylist
-            addToPlaylist.isHidden = isPlaylist
-        }
-    }
-
-    func addChildren() {
-        backgroundColor = .white
-        addSubview(hStack)
-        hStack.addArrangedSubview(removeFromPlaylist)
-        hStack.addArrangedSubview(addToPlaylist)
-        hStack.addArrangedSubview(deleteView)
-
-        removeFromPlaylist.isHidden = !isPlaylist
-        addToPlaylist.isHidden = isPlaylist
-    }
-
-    func makeConstraints() {
-        hStack.snp.makeConstraints { make in
-            make.top.equalToSuperview().offset(12)
-            make.leading.trailing.equalToSuperview()
-            make.bottom.equalTo(safeAreaLayoutGuide.snp.bottom)
-        }
-    }
-
-    required init?(coder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-}

+ 0 - 140
TSLiveWallpaper/Business/TSMusic/Search/Controller/LocalSearchViewController.swift

@@ -1,140 +0,0 @@
-//
-//  LocalSearchViewController.swift
-//  ColorfulWallpaper
-//
-//  Created by ni on 2024/9/19.
-//
-
-import Combine
-import Foundation
-import TSVideoKit
-
-class LocalSearchViewController: LWBGViewController {
-    private var cancellables = [AnyCancellable]()
-
-    lazy var backButton: UIButton = {
-        let btn = UIButton()
-        btn.setImage(UIImage(named: "navi_back_white"), for: .normal)
-        btn.addTarget(self, action: #selector(popupCurrentVc), for: .touchUpInside)
-        return btn
-    }()
-
-    lazy var searchBar: CWSearchTextBar = {
-        let bar = CWSearchTextBar()
-        bar.textFiled.delegate = self
-        bar.textFiled.textColor = .white
-        bar.textFiled.attributedPlaceholder = NSAttributedString(string: "Search Music".localized(), attributes: [
-            .foregroundColor: UIColor.hexColor("#FFFFFF").withAlphaComponent(0.4),
-            .font: UIFont.systemFont(ofSize: 14)])
-        return bar
-    }()
-
-    lazy var viewModel: LocalSearchViewModel = LocalSearchViewModel()
-
-    lazy var listView: UITableView = {
-        let tabView = UITableView()
-        tabView.dataSource = viewModel
-        tabView.backgroundColor = .clear
-        tabView.delegate = self
-        tabView.separatorStyle = .none
-        tabView.register(SongListCell.self, forCellReuseIdentifier: "SongListCell")
-        return tabView
-    }()
-
-    override func viewDidLoad() {
-        super.viewDidLoad()
-        bgImageView.image = .viewMainBg
-        addChildren()
-        makeConstraints()
-        addNotifaction()
-    }
-
-    override func viewDidAppear(_ animated: Bool) {
-        super.viewDidAppear(animated)
-        searchBar.textFiled.becomeFirstResponder()
-    }
-
-    override func addChildren() {
-        super.addChildren()
-        view.addSubview(backButton)
-        view.addSubview(searchBar)
-        view.addSubview(listView)
-    }
-
-    override func addNotifaction() {
-        super.addNotifaction()
-
-        viewModel.$videos.receive(on: DispatchQueue.main).sink { [weak self] _ in
-            self?.listView.reloadData()
-        }.store(in: &cancellables)
-
-        NotificationCenter.default.addObserver(self, selector: #selector(reloadData), name: kDataChangedNotifactionName, object: nil)
-        NotificationCenter.default.addObserver(self, selector: #selector(reloadData), name: .K_RefreshNotifaction, object: nil)
-    }
-
-    @objc func reloadData() {
-        viewModel.requestAssociateRelate()
-    }
-
-    override func viewDidDisappear(_ animated: Bool) {
-        super.viewDidDisappear(animated)
-    }
-
-    func cancelSubscriptions() {
-        // 取消所有订阅
-        cancellables.removeAll()
-    }
-
-    deinit {
-        NotificationCenter.default.removeObserver(self)
-        cancelSubscriptions()
-    }
-}
-
-extension LocalSearchViewController: UITextFieldDelegate, UITableViewDelegate, UIScrollViewDelegate {
-    func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
-        let items = viewModel.videos
-        if indexPath.row < items.count {
-            let video = items[indexPath.row]
-            let list = TSVideoOperator.shared.dataManager.fetchCachedVideos(sort: viewModel.sort)
-            PlayerManager.shared.playVideo(video: video, list: list, scene: .local, onceAdKey: "")
-        }
-        searchBar.textFiled.resignFirstResponder()
-    }
-
-    func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool {
-        let originalText = textField.text ?? ""
-        // Calculate the new text after replacement
-        let updatedText = (originalText as NSString).replacingCharacters(in: range, with: string)
-        listView.isHidden = updatedText.isEmpty
-        viewModel.keyword = updatedText
-
-        return true
-    }
-
-    func scrollViewWillBeginDragging(_ scrollView: UIScrollView) {
-        searchBar.textFiled.resignFirstResponder()
-    }
-}
-
-extension LocalSearchViewController {
-    func makeConstraints() {
-        backButton.snp.makeConstraints { make in
-            make.width.height.equalTo(40)
-            make.leading.equalToSuperview().offset(8)
-            make.top.equalTo(view.safeAreaLayoutGuide.snp.top)
-        }
-
-        searchBar.snp.makeConstraints { make in
-            make.leading.equalTo(backButton.snp.trailing).offset(6)
-            make.trailing.equalToSuperview().offset(-16)
-            make.height.equalTo(40)
-            make.centerY.equalTo(backButton)
-        }
-
-        listView.snp.makeConstraints { make in
-            make.leading.trailing.bottom.equalToSuperview()
-            make.top.equalTo(searchBar.snp.bottom)
-        }
-    }
-}

+ 0 - 217
TSLiveWallpaper/Business/TSMusic/Search/Controller/SearchOnlineViewController.swift

@@ -1,217 +0,0 @@
-//
-//  SearchOnlineViewController.swift
-//  ColorfulWallpaper
-//
-//  Created by nkl on 2024/9/11.
-//
-
-import Combine
-import Foundation
-import KLExtension
-import SwiftUI
-import UIKit
-
-class SearchOnlineViewController: LWBGViewController {
-    private var cancellables = [AnyCancellable]()
-
-    lazy var searchBar: CWSearchTextBar = {
-        let bar = CWSearchTextBar()
-        bar.textFiled.delegate = self
-        bar.backgroundColor = .white.withAlphaComponent(0.1)
-        bar.textFiled.textColor = .white
-        bar.textFiled.attributedPlaceholder = NSAttributedString(string: "Search Music".localized(), attributes: [
-            .foregroundColor: UIColor.hexColor("#FFFFFF").withAlphaComponent(0.4),
-            .font: UIFont.systemFont(ofSize: 14)])
-        bar.customCornerRadius = 8
-        return bar
-    }()
-
-    lazy var backButton: UIButton = {
-        let btn = UIButton()
-        btn.setImage(UIImage(named: "navi_back_white"), for: .normal)
-        btn.addTarget(self, action: #selector(popupCurrentVc), for: .touchUpInside)
-        return btn
-    }()
-
-    lazy var searchButton: UIButton = {
-        let btn = UIButton()
-        btn.setTitle("Search".localized(), for: .normal)
-        btn.setTitleColor(.white, for: .normal)
-        btn.titleLabel?.font = .systemFont(ofSize: 14)
-        btn.addTarget(self, action: #selector(searchKeyWord), for: .touchUpInside)
-        return btn
-    }()
-
-    lazy var historyController: UIHostingController = {
-        let tagView = TagListView { tag in
-            self.beginSearchKeyword(history: tag)
-        }
-        let vc = UIHostingController(rootView: tagView)
-        vc.view.backgroundColor = .clear
-        return vc
-    }()
-
-    lazy var viewModel: SearchViewModel = SearchViewModel()
-
-    lazy var listView: UITableView = {
-        let tabView = UITableView()
-        tabView.dataSource = viewModel
-        tabView.backgroundColor = .clear
-        tabView.delegate = self
-        tabView.separatorStyle = .none
-        tabView.register(RelateSeachCell.self, forCellReuseIdentifier: "RelateSeachCell")
-        return tabView
-    }()
-
-    override func viewDidLoad() {
-        super.viewDidLoad()
-        addNotifaction()
-    }
-
-    override func viewWillAppear(_ animated: Bool) {
-        super.viewWillAppear(animated)
-        PlayerManager.shared.miniBar.isHidden = false
-        PlayerManager.shared.rootVc?.moveDownMiniBar()
-    }
-
-    override func viewDidAppear(_ animated: Bool) {
-        super.viewDidAppear(animated)
-        searchBar.textFiled.becomeFirstResponder()
-    }
-
-    override func addChildren() {
-        super.addChildren()
-        bgImageView.image = .viewMainBg
-        addChild(historyController)
-        view.addSubview(backButton)
-        view.addSubview(searchBar)
-        view.addSubview(searchButton)
-        view.addSubview(listView)
-        view.addSubview(historyController.view)
-    }
-
-    override func makeConstarints() {
-        super.makeConstarints()
-        backButton.snp.makeConstraints { make in
-            make.width.height.equalTo(40)
-            make.leading.equalToSuperview().offset(8)
-            make.top.equalTo(view.safeAreaLayoutGuide.snp.top)
-        }
-
-        searchBar.snp.makeConstraints { make in
-            make.leading.equalTo(backButton.snp.trailing)
-            make.trailing.equalTo(searchButton.snp.leading).offset(-8)
-            make.height.equalTo(40)
-            make.centerY.equalTo(backButton)
-        }
-        searchButton.sizeToFit()
-        searchButton.snp.makeConstraints { make in
-            make.trailing.equalToSuperview().offset(-16)
-            make.centerY.equalTo(searchBar)
-            make.height.equalTo(40)
-            make.width.equalTo(searchButton.width)
-        }
-
-        listView.snp.makeConstraints { make in
-            make.leading.trailing.bottom.equalToSuperview()
-            make.top.equalTo(searchButton.snp.bottom)
-        }
-
-        historyController.view.snp.makeConstraints { make in
-            make.leading.trailing.bottom.equalToSuperview()
-            make.top.equalTo(searchButton.snp.bottom)
-        }
-    }
-
-    func beginSearchKeyword(history: HistoryModel) {
-        let vc = SearchResultViewController()
-        vc.viewModel.searchModel = .init(query: history.keyword)
-        recordHistory(keyword: history.keyword)
-        navigationController?.pushViewController(vc, animated: true)
-    }
-
-    @objc func searchKeyWord() {
-        if searchBar.textFiled.text?.isEmpty == true {
-            return
-        }
-        searchBar.textFiled.resignFirstResponder()
-        viewModel.keyword = searchBar.textFiled.text ?? ""
-
-        let vc = SearchResultViewController()
-        vc.viewModel.searchModel = .init(query: searchBar.textFiled.text ?? "")
-        recordHistory(keyword: searchBar.textFiled.text ?? "")
-        navigationController?.pushViewController(vc, animated: true)
-    }
-
-    override func addNotifaction() {
-        super.addNotifaction()
-        viewModel.$relateModel.receive(on: DispatchQueue.main).sink { [weak self] _ in
-            self?.listView.reloadData()
-        }.store(in: &cancellables)
-    }
-
-    override func viewDidDisappear(_ animated: Bool) {
-        super.viewDidDisappear(animated)
-    }
-
-    func cancelSubscriptions() {
-        // 取消所有订阅
-        cancellables.removeAll()
-    }
-
-    deinit {
-        cancelSubscriptions()
-    }
-}
-
-extension SearchOnlineViewController: UITextFieldDelegate, UITableViewDelegate, UIScrollViewDelegate {
-    func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
-        let items = viewModel.relateModel?.relateItems ?? []
-        if indexPath.row < items.count {
-            if let keyword = viewModel.relateModel?.relateItems[indexPath.row] {
-                let vc = SearchResultViewController()
-                vc.viewModel.searchModel = .init(query: keyword)
-                recordHistory(keyword: keyword)
-                navigationController?.pushViewController(vc, animated: true)
-            }
-        }
-
-        searchBar.textFiled.resignFirstResponder()
-    }
-
-    func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool {
-        let originalText = textField.text ?? ""
-        // Calculate the new text after replacement
-        let updatedText = (originalText as NSString).replacingCharacters(in: range, with: string)
-        listView.isHidden = updatedText.isEmpty
-        historyController.view.isHidden = !updatedText.isEmpty
-        viewModel.keyword = updatedText
-
-        return true
-    }
-
-    func textFieldShouldReturn(_ textField: UITextField) -> Bool {
-        searchKeyWord()
-        return true
-    }
-
-    func scrollViewWillBeginDragging(_ scrollView: UIScrollView) {
-        searchBar.textFiled.resignFirstResponder()
-    }
-
-    func recordHistory(keyword: String) {
-        let model = HistoryModel(keyword: keyword, id: UUID().uuidString, date: Date())
-        let storage = CodableStorage()
-        do {
-            var history: [HistoryModel] = try storage.fetch(for: kStore_History_Key)
-            history.removeAll {
-                $0.keyword == keyword
-            }
-            history.insert(model, at: 0)
-            try storage.save(history, for: kStore_History_Key)
-        } catch {
-            let history: [HistoryModel] = [model]
-            try? storage.save(history, for: kStore_History_Key)
-        }
-    }
-}

+ 0 - 53
TSLiveWallpaper/Business/TSMusic/Search/ViewModel/LocalSearchViewModel.swift

@@ -1,53 +0,0 @@
-//
-//  LocalSearchViewModel.swift
-//  ColorfulWallpaper
-//
-//  Created by ni on 2024/9/19.
-//
-
-import Foundation
-import TSVideoKit
-
-class LocalSearchViewModel: NSObject {
-    @Published var videos: [TSVideo] = []
-
-    var keyword: String = "" {
-        didSet {
-            requestAssociateRelate()
-        }
-    }
-
-    var task: URLSessionTask?
-    
-    var sort : NSSortDescriptor?
-
-    func requestAssociateRelate() {
-        if keyword.isEmpty {
-            return
-        }
-        
-        self.videos = TSVideoOperator.shared.dataManager.fuzzySearchVideos(byTitle: keyword,sort: sort)
-    }
-}
-
-extension LocalSearchViewModel: UITableViewDataSource {
-    func numberOfSections(in tableView: UITableView) -> Int {
-        return 1
-    }
-
-    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
-        return videos.count
-    }
-
-    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
-        if let cell = tableView.dequeueReusableCell(withIdentifier: "SongListCell", for: indexPath) as? SongListCell {
-            if indexPath.row < videos.count {
-                let video = videos[indexPath.row]
-                cell.bindData(video: video)
-            }
-               
-            return cell
-        }
-        return SongListCell()
-    }
-}

Някои файлове не бяха показани, защото твърде много файлове са промени