kailen 1 месяц назад
Родитель
Сommit
afa0f84d03
99 измененных файлов с 9 добавлено и 10444 удалено
  1. BIN
      .DS_Store
  2. 0 1
      Bridging-Header.h
  3. 0 2
      Podfile
  4. 1 91
      Podfile.lock
  5. 4 520
      TSLiveWallpaper.xcodeproj/project.pbxproj
  6. 1 33
      TSLiveWallpaper/AppDelegate.swift
  7. BIN
      TSLiveWallpaper/Assets.xcassets/Purchase/.DS_Store
  8. 0 2
      TSLiveWallpaper/Business/TSAIListVC/TSAIListVC/TSAIListVC.swift
  9. 0 14
      TSLiveWallpaper/Business/TSMusic/Consts/Consts.swift
  10. 0 64
      TSLiveWallpaper/Business/TSMusic/Custom/BasePresentViewController.swift
  11. 0 135
      TSLiveWallpaper/Business/TSMusic/Custom/BubbleMenuView.swift
  12. 0 25
      TSLiveWallpaper/Business/TSMusic/Custom/FitManager.swift
  13. 0 70
      TSLiveWallpaper/Business/TSMusic/Custom/ImageTextControl.swift
  14. 0 75
      TSLiveWallpaper/Business/TSMusic/Custom/ManageMenuAlertView.swift
  15. 0 102
      TSLiveWallpaper/Business/TSMusic/Custom/MusicEmptyView.swift
  16. 0 59
      TSLiveWallpaper/Business/TSMusic/Custom/MusicSearchBar.swift
  17. 0 21
      TSLiveWallpaper/Business/TSMusic/Custom/NotifactionKey.swift
  18. 0 149
      TSLiveWallpaper/Business/TSMusic/Custom/PlayMiniBar.swift
  19. 0 92
      TSLiveWallpaper/Business/TSMusic/Custom/THUD+CW.swift
  20. 0 100
      TSLiveWallpaper/Business/TSMusic/Custom/THUD.swift
  21. 0 20
      TSLiveWallpaper/Business/TSMusic/Custom/THUDProtocol.swift
  22. 0 125
      TSLiveWallpaper/Business/TSMusic/Custom/TipsView.swift
  23. 0 206
      TSLiveWallpaper/Business/TSMusic/Custom/ToastView.swift
  24. 0 29
      TSLiveWallpaper/Business/TSMusic/Detail/Controller/PlayDetailViewController+Ext.swift
  25. 0 464
      TSLiveWallpaper/Business/TSMusic/Detail/Controller/PlayDetailViewController.swift
  26. 0 206
      TSLiveWallpaper/Business/TSMusic/Detail/Controller/SleepTimeViewController.swift
  27. 0 210
      TSLiveWallpaper/Business/TSMusic/Detail/PlayerManager.swift
  28. 0 49
      TSLiveWallpaper/Business/TSMusic/Detail/View/PlayButtonView.swift
  29. 0 267
      TSLiveWallpaper/Business/TSMusic/Detail/View/PlayDetailControlView.swift
  30. 0 38
      TSLiveWallpaper/Business/TSMusic/Detail/View/PlayDetailPlaceHolderView.swift
  31. 0 91
      TSLiveWallpaper/Business/TSMusic/Detail/View/PlayDetailTopView.swift
  32. 0 62
      TSLiveWallpaper/Business/TSMusic/Helper/CWCustomProgressView.swift
  33. 0 53
      TSLiveWallpaper/Business/TSMusic/Helper/CWLoadingView.swift
  34. 0 44
      TSLiveWallpaper/Business/TSMusic/Helper/CWMutiSelectOpeateView.swift
  35. 0 59
      TSLiveWallpaper/Business/TSMusic/Helper/CWOperateButton.swift
  36. 0 50
      TSLiveWallpaper/Business/TSMusic/Helper/CWOperateItemView.swift
  37. 0 152
      TSLiveWallpaper/Business/TSMusic/Helper/CWOperateViewController+Ext.swift
  38. 0 123
      TSLiveWallpaper/Business/TSMusic/Helper/CWOperateViewController.swift
  39. 0 550
      TSLiveWallpaper/Business/TSMusic/Helper/CWProgressView.swift
  40. 0 181
      TSLiveWallpaper/Business/TSMusic/Helper/DownloadButton.swift
  41. 0 174
      TSLiveWallpaper/Business/TSMusic/Helper/FilterBarView.swift
  42. 0 147
      TSLiveWallpaper/Business/TSMusic/Helper/FilterBarViewController.swift
  43. 0 82
      TSLiveWallpaper/Business/TSMusic/Helper/FilterBarViewModel.swift
  44. 0 57
      TSLiveWallpaper/Business/TSMusic/Helper/GuideBubbleView.swift
  45. 0 135
      TSLiveWallpaper/Business/TSMusic/Helper/OperateTopView.swift
  46. 0 185
      TSLiveWallpaper/Business/TSMusic/Helper/SortMenuViewController.swift
  47. 0 40
      TSLiveWallpaper/Business/TSMusic/Helper/VipTagView.swift
  48. 0 128
      TSLiveWallpaper/Business/TSMusic/Import/ImportFilesManager.swift
  49. 0 103
      TSLiveWallpaper/Business/TSMusic/List/Controller/CustomSegementItem.swift
  50. 0 126
      TSLiveWallpaper/Business/TSMusic/List/Controller/MusicHomeContainerViewController.swift
  51. 0 131
      TSLiveWallpaper/Business/TSMusic/List/Controller/MusicPlaylistContainerViewController.swift
  52. 0 24
      TSLiveWallpaper/Business/TSMusic/List/Controller/SongListViewController+Target.swift
  53. 0 251
      TSLiveWallpaper/Business/TSMusic/List/Controller/SongListViewController.swift
  54. 0 42
      TSLiveWallpaper/Business/TSMusic/List/View/CDView.swift
  55. 0 56
      TSLiveWallpaper/Business/TSMusic/List/View/CWTopCustomButton.swift
  56. 0 95
      TSLiveWallpaper/Business/TSMusic/List/View/PlaylistTopView.swift
  57. 0 176
      TSLiveWallpaper/Business/TSMusic/List/View/SongDownloadCell.swift
  58. 0 189
      TSLiveWallpaper/Business/TSMusic/List/View/SongListCell.swift
  59. 0 75
      TSLiveWallpaper/Business/TSMusic/List/View/SongListTopView.swift
  60. 0 12
      TSLiveWallpaper/Business/TSMusic/List/ViewModel/MusicContainerViewModel.swift
  61. 0 24
      TSLiveWallpaper/Business/TSMusic/List/ViewModel/SongDownloadCellViewModel.swift
  62. 0 155
      TSLiveWallpaper/Business/TSMusic/List/ViewModel/SongListViewModel.swift
  63. 0 0
      TSLiveWallpaper/Business/TSMusic/MusicBase/SpacedButton.swift
  64. 0 29
      TSLiveWallpaper/Business/TSMusic/OC/IJKPlayer/Core/SJIJKMediaPlayer.h
  65. 0 611
      TSLiveWallpaper/Business/TSMusic/OC/IJKPlayer/Core/SJIJKMediaPlayer.m
  66. 0 24
      TSLiveWallpaper/Business/TSMusic/OC/IJKPlayer/Core/SJIJKMediaPlayerLayerView.h
  67. 0 46
      TSLiveWallpaper/Business/TSMusic/OC/IJKPlayer/Core/SJIJKMediaPlayerLayerView.m
  68. 0 0
      TSLiveWallpaper/Business/TSMusic/OC/IJKPlayer/IJKPlayer.md
  69. 0 22
      TSLiveWallpaper/Business/TSMusic/OC/IJKPlayer/SJIJKMediaPlaybackController.h
  70. 0 88
      TSLiveWallpaper/Business/TSMusic/OC/IJKPlayer/SJIJKMediaPlaybackController.m
  71. 0 8
      TSLiveWallpaper/Business/TSMusic/OC/IJKPlayer/TSAvatar-Header.h
  72. 0 208
      TSLiveWallpaper/Business/TSMusic/PlayList/Controller/AddPlayListViewController.swift
  73. 0 122
      TSLiveWallpaper/Business/TSMusic/PlayList/Controller/PlayDetailListViewContoller.swift
  74. 0 355
      TSLiveWallpaper/Business/TSMusic/PlayList/Controller/PlaylistDetailViewController.swift
  75. 0 32
      TSLiveWallpaper/Business/TSMusic/PlayList/Controller/PlaylistViewController+Ext.swift
  76. 0 128
      TSLiveWallpaper/Business/TSMusic/PlayList/Controller/PlaylistViewController.swift
  77. 0 72
      TSLiveWallpaper/Business/TSMusic/PlayList/ViewModel/AddPlayListViewModel.swift
  78. 0 77
      TSLiveWallpaper/Business/TSMusic/PlayList/ViewModel/PlayDetailListViewModel.swift
  79. 0 88
      TSLiveWallpaper/Business/TSMusic/PlayList/ViewModel/PlayListDetaiViewModel.swift
  80. 0 84
      TSLiveWallpaper/Business/TSMusic/PlayList/ViewModel/PlayListViewModel.swift
  81. 0 145
      TSLiveWallpaper/Business/TSMusic/PlayList/ViewModel/SongListManageViewModel.swift
  82. 0 131
      TSLiveWallpaper/Business/TSMusic/PlayList/Views/PlayDetailListViewCell.swift
  83. 0 57
      TSLiveWallpaper/Business/TSMusic/PlayList/Views/PlayListAddCell.swift
  84. 0 134
      TSLiveWallpaper/Business/TSMusic/PlayList/Views/PlayListCell.swift
  85. 0 74
      TSLiveWallpaper/Business/TSMusic/PlayList/Views/PlayListManageView.swift
  86. 0 43
      TSLiveWallpaper/Business/TSMusic/PlayList/Views/PlayListTopItemView.swift
  87. 0 71
      TSLiveWallpaper/Business/TSMusic/PlayList/Views/SongListBottomView.swift
  88. 0 140
      TSLiveWallpaper/Business/TSMusic/Search/Controller/LocalSearchViewController.swift
  89. 0 53
      TSLiveWallpaper/Business/TSMusic/Search/ViewModel/LocalSearchViewModel.swift
  90. 0 55
      TSLiveWallpaper/Business/TSMusic/Search/Views/CWSearchTextBar.swift
  91. 0 22
      TSLiveWallpaper/Business/TSMusic/Search/Views/CustomTextField.swift
  92. 0 59
      TSLiveWallpaper/Business/TSMusic/Search/Views/LWSearchBar.swift
  93. 0 51
      TSLiveWallpaper/Business/TSMusic/Search/Views/RelateSeachCell.swift
  94. 0 230
      TSLiveWallpaper/Business/TSMusic/Search/Views/TagListView.swift
  95. 2 0
      TSLiveWallpaper/Business/TSPurchaseMembershipVC/TSPurchaseVC.swift
  96. 1 153
      TSLiveWallpaper/Business/TSTabBarController/TSTabBarController.swift
  97. 0 15
      TSLiveWallpaper/LaunchVC/TSLaunchVC.swift
  98. BIN
      TSLiveWallpaper/Resource/Example/Example Music.mp3
  99. 0 76
      TSLiveWallpaper/Resource/Example/ExampleIniter.swift

+ 0 - 1
Bridging-Header.h

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

+ 0 - 2
Podfile

@@ -19,8 +19,6 @@ target 'TSLiveWallpaper' do
   pod 'TZImagePickerController'
   pod 'MarqueeLabel'
   pod 'MJRefresh'
-  pod 'TSVideoKit', :git => 'https://gitee.com/WanlanNeel/tsvideo-kit.git', :branch => 'feature/local'
-  pod "IJKMediaFramework", :podspec => 'https://github.com/debugly/ijkplayer/releases/download/k0.8.9/IJKMediaFramework.spec.json'
   pod 'KLExtension',:git=>"https://gitee.com/WanlanNeel/klextension.git"
   pod 'KLTips',:git=>"https://gitee.com/WanlanNeel/kltips.git"
   pod 'Localize-Swift', '~> 3.2'

+ 1 - 91
Podfile.lock

@@ -17,7 +17,6 @@ PODS:
   - Alamofire (5.10.2)
   - BetterSegmentedControl (2.0.1)
   - DynamicBlurView (5.0.3)
-  - IJKMediaFramework (0.8.9)
   - Kingfisher (7.10.0)
   - KLExtension (0.1.0)
   - KLTips (0.1.0)
@@ -28,7 +27,6 @@ PODS:
   - Localize-Swift/UIKit (3.2.0):
     - Localize-Swift/LocalizeSwiftCore
   - MarqueeLabel (4.5.0)
-  - Masonry (1.1.0)
   - MJRefresh (3.7.5)
   - ObjectMapper (4.2.0)
   - Realm (10.54.4):
@@ -36,65 +34,6 @@ PODS:
   - Realm/Headers (10.54.4)
   - RealmSwift (10.54.4):
     - Realm (= 10.54.4)
-  - 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)
   - SVProgressHUD (2.3.1):
     - SVProgressHUD/Core (= 2.3.1)
@@ -105,26 +44,18 @@ PODS:
     - ObjectMapper (~> 4.2)
     - SnapKit
     - SVProgressHUD
-  - TSVideoKit (0.1.0):
-    - AFNetworking
-    - Alamofire
-    - Kingfisher
-    - SJVideoPlayer
-    - SnapKit
   - TYCyclePagerView (1.2.0)
   - TZImagePickerController (3.8.8):
     - TZImagePickerController/Basic (= 3.8.8)
     - TZImagePickerController/Location (= 3.8.8)
   - TZImagePickerController/Basic (3.8.8)
   - TZImagePickerController/Location (3.8.8)
-  - YYModel (1.0.4)
 
 DEPENDENCIES:
   - AFNetworking (from `https://github.com/xlDon/AFNetworking-PrivacyInfo.git`)
   - Alamofire
   - BetterSegmentedControl (~> 2.0)
   - DynamicBlurView
-  - IJKMediaFramework (from `https://github.com/debugly/ijkplayer/releases/download/k0.8.9/IJKMediaFramework.spec.json`)
   - Kingfisher (= 7.10.0)
   - KLExtension (from `https://gitee.com/WanlanNeel/klextension.git`)
   - KLTips (from `https://gitee.com/WanlanNeel/kltips.git`)
@@ -136,7 +67,6 @@ DEPENDENCIES:
   - SnapKit
   - SVProgressHUD
   - TSSmalCoacopods (from `../TSSmalCoacopods`)
-  - TSVideoKit (from `https://gitee.com/WanlanNeel/tsvideo-kit.git`, branch `feature/local`)
   - TYCyclePagerView
   - TZImagePickerController
 
@@ -148,34 +78,24 @@ SPEC REPOS:
     - Kingfisher
     - Localize-Swift
     - MarqueeLabel
-    - Masonry
     - MJRefresh
     - ObjectMapper
     - Realm
     - RealmSwift
-    - SJBaseVideoPlayer
-    - SJUIKit
-    - SJVideoPlayer
     - SnapKit
     - SVProgressHUD
     - TYCyclePagerView
     - TZImagePickerController
-    - YYModel
 
 EXTERNAL SOURCES:
   AFNetworking:
     :git: https://github.com/xlDon/AFNetworking-PrivacyInfo.git
-  IJKMediaFramework:
-    :podspec: https://github.com/debugly/ijkplayer/releases/download/k0.8.9/IJKMediaFramework.spec.json
   KLExtension:
     :git: https://gitee.com/WanlanNeel/klextension.git
   KLTips:
     :git: https://gitee.com/WanlanNeel/kltips.git
   TSSmalCoacopods:
     :path: "../TSSmalCoacopods"
-  TSVideoKit:
-    :branch: feature/local
-    :git: https://gitee.com/WanlanNeel/tsvideo-kit.git
 
 CHECKOUT OPTIONS:
   AFNetworking:
@@ -187,37 +107,27 @@ CHECKOUT OPTIONS:
   KLTips:
     :commit: dc38e277b3d62f753ce6c73ec62c0f8ae29c1b36
     :git: https://gitee.com/WanlanNeel/kltips.git
-  TSVideoKit:
-    :commit: 5ad45b75e2335442ec5633a5a614e45ac2f9fb3a
-    :git: https://gitee.com/WanlanNeel/tsvideo-kit.git
 
 SPEC CHECKSUMS:
   AFNetworking: 07fdd55e08bfc815311d558d62b0f9660ef83d1e
   Alamofire: 7193b3b92c74a07f85569e1a6c4f4237291e7496
   BetterSegmentedControl: 09607b27861d49cbce48b7673b74f9150a3d371a
   DynamicBlurView: b57e2f6aa33f85b2bcca272265162a3c7c5cc499
-  IJKMediaFramework: aa80bbca8d5443171b2c4d5cc025cc013b2172e3
   Kingfisher: a18f05d3b6d37d8650ee4a3e61d57a28fc6207f6
   KLExtension: f8b2a92125ad4bbfc8920ed5e7269aefcdcaa0b3
   KLTips: 5cf05efac78b9c813887460bebbf436582b20536
   Localize-Swift: 6f4475136bdb0d7b2882ea3d4ea919d70142b232
   MarqueeLabel: 4b46d196abd253448e830cbd976f9eacc3af0849
-  Masonry: 678fab65091a9290e40e2832a55e7ab731aad201
   MJRefresh: fdf5e979eb406a0341468932d1dfc8b7f9fce961
   ObjectMapper: 1eb41f610210777375fa806bf161dc39fb832b81
   Realm: 8b5cda39a41f17a1734da2f39c6004eb8745587a
   RealmSwift: 0b4f808fed6898f1f6c26f501f740efd80dff0b4
-  SJBaseVideoPlayer: b3122de12225b27b71bd9a8a1f08f4dcf2f4e5ec
-  SJUIKit: a40111941e408cc17d4c1c23495aa92999e814b0
-  SJVideoPlayer: 4f09814f58522e0975cb2dccfda925f6c8643467
   SnapKit: d612e99e678a2d3b95bf60b0705ed0a35c03484a
   SVProgressHUD: 4837c74bdfe2e51e8821c397825996a8d7de6e22
   TSSmalCoacopods: 6aa97167f0c76b16fc7d1fd1eb198bb6aece4f68
-  TSVideoKit: 922402ea051d72e78224f22d37c10fdb2e378f60
   TYCyclePagerView: 2b051dade0615c70784aa34f40c646feeddb7344
   TZImagePickerController: d084a7b97c82d387e7669dd86dc9a9057500aacf
-  YYModel: 2a7fdd96aaa4b86a824e26d0c517de8928c04b30
 
-PODFILE CHECKSUM: 9ef89fbe0d8e037e47c74750a3a222191b93c7ca
+PODFILE CHECKSUM: 5cbebc045aa8aafa7a1ab7df0b261de22231dead
 
 COCOAPODS: 1.16.2

+ 4 - 520
TSLiveWallpaper.xcodeproj/project.pbxproj

@@ -9,82 +9,7 @@
 /* Begin PBXBuildFile section */
 		059E844A164B0E39971303B9 /* Pods_TSLiveWallpaper.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E33A770AEFA5810AED7219D3 /* Pods_TSLiveWallpaper.framework */; };
 		603901222DF9770A0096551E /* Flash-old-Time.png in Resources */ = {isa = PBXBuildFile; fileRef = 603901212DF9770A0096551E /* Flash-old-Time.png */; };
-		60553F722D3B528A00BAAD7F /* PlayDetailListViewContoller.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60553F242D3B528A00BAAD7F /* PlayDetailListViewContoller.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 */; };
-		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 */; };
-		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 */; };
-		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 */; };
-		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 */; };
-		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 */; };
+		603901612DFFF0330096551E /* SpacedButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 603901602DFFF0330096551E /* SpacedButton.swift */; };
 		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 */; };
@@ -92,16 +17,8 @@
 		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 */; };
 		60553FDD2D3B84E700BAAD7F /* UIScrollView+Ext.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60553FDC2D3B84E700BAAD7F /* UIScrollView+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 */; };
-		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 */; };
-		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 */; };
 		A81CA46E2D156C7000A3AAC8 /* GlobalImports.swift in Sources */ = {isa = PBXBuildFile; fileRef = A81CA46D2D156C6F00A3AAC8 /* GlobalImports.swift */; };
 		A81CA47F2D15789C00A3AAC8 /* TSConfig.swift in Sources */ = {isa = PBXBuildFile; fileRef = A81CA47E2D15789A00A3AAC8 /* TSConfig.swift */; };
@@ -215,86 +132,7 @@
 
 /* Begin PBXFileReference section */
 		603901212DF9770A0096551E /* Flash-old-Time.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Flash-old-Time.png"; sourceTree = "<group>"; };
-		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>"; };
-		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>"; };
-		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>"; };
-		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>"; };
+		603901602DFFF0330096551E /* 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>"; };
@@ -302,13 +140,7 @@
 		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>"; };
 		60553FDC2D3B84E700BAAD7F /* UIScrollView+Ext.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIScrollView+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>"; };
-		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>"; };
 		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>"; };
@@ -318,8 +150,6 @@
 		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>"; };
 		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>"; };
 		A81CA4642D15685D00A3AAC8 /* TSLaunchVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TSLaunchVC.swift; sourceTree = "<group>"; };
 		A81CA46D2D156C6F00A3AAC8 /* GlobalImports.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GlobalImports.swift; sourceTree = "<group>"; };
@@ -463,275 +293,14 @@
 			isa = PBXGroup;
 			children = (
 				60553FCF2D3B54A400BAAD7F /* MusicBase */,
-				60553F0D2D3B528A00BAAD7F /* OC */,
-				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>";
-		};
-		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 = (
-				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 = (
-				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 = (
+				603901602DFFF0330096551E /* SpacedButton.swift */,
 				60553FC72D3B54A400BAAD7F /* LWNavigationBar.swift */,
 				60553FC82D3B54A400BAAD7F /* LWBaseViewController.swift */,
 				60553FC92D3B54A400BAAD7F /* LWBaseNavigationController.swift */,
@@ -746,9 +315,7 @@
 		606372D62D545E55005C82CF /* Example */ = {
 			isa = PBXGroup;
 			children = (
-				606372D72D545E6C005C82CF /* Example Music.mp3 */,
 				603901212DF9770A0096551E /* Flash-old-Time.png */,
-				606372D92D545F0D005C82CF /* ExampleIniter.swift */,
 			);
 			path = Example;
 			sourceTree = "<group>";
@@ -1403,12 +970,10 @@
 			buildActionMask = 2147483647;
 			files = (
 				603901222DF9770A0096551E /* Flash-old-Time.png in Resources */,
-				606372D82D545E6C005C82CF /* Example Music.mp3 in Resources */,
 				A8C4C0A42D24218A003C46FC /* metadata.mov in Resources */,
 				A86857D72DF983620089D222 /* generat_loading.gif in Resources */,
 				A86857C62DF92BE70089D222 /* ZillaSlab-Bold.ttf in Resources */,
 				A8FD8F472DFC3092008CAACF /* launch2.png in Resources */,
-				60553FC42D3B528A00BAAD7F /* IJKPlayer.md in Resources */,
 				609B6EA52D6F1221007942D4 /* Localizable.strings in Resources */,
 				A8FD8F332DFBCB85008CAACF /* ZillaSlab-Regular.ttf in Resources */,
 				A8FD8F342DFBCB85008CAACF /* ZillaSlab-Medium.ttf in Resources */,
@@ -1468,14 +1033,11 @@
 			isa = PBXSourcesBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
-				60553FDB2D3B7CC600BAAD7F /* FitManager.swift in Sources */,
 				A81CA4992D1652C400A3AAC8 /* TSMineVC.swift in Sources */,
 				A8C4C0EF2D27BFF7003C46FC /* TSNetworkTool.swift in Sources */,
 				A81CA46E2D156C7000A3AAC8 /* GlobalImports.swift in Sources */,
 				A8FD8F382DFBD660008CAACF /* TSMineTopView.swift in Sources */,
-				606372E52D55BAB8005C82CF /* GuideBubbleView.swift in Sources */,
 				A81CA4832D157F5C00A3AAC8 /* UIImageView+Ex.swift in Sources */,
-				60F82C112D43298800FFB08D /* MusicContainerViewModel.swift in Sources */,
 				A81F5B492D1956EA00740085 /* UIScreen.swift in Sources */,
 				A8FD8F412DFC138A008CAACF /* TYCycleImageComparisonView.swift in Sources */,
 				A8C4C0E62D268D02003C46FC /* LivePhotoCreater.swift in Sources */,
@@ -1485,7 +1047,6 @@
 				A83946312D1D66A000ABFF0D /* TSTermsServiceVC.swift in Sources */,
 				A8C4C0982D242154003C46FC /* LivePhoto.swift in Sources */,
 				A81F5B472D19562800740085 /* EditorVideoControlMaskView.swift in Sources */,
-				606372DA2D545F0D005C82CF /* ExampleIniter.swift in Sources */,
 				A81CA4AA2D16943800A3AAC8 /* TSMineCell.swift in Sources */,
 				A83946212D1D61D600ABFF0D /* TSRateUsVC.swift in Sources */,
 				A81F5B4F2D19674600740085 /* AVAsset+Ex.swift in Sources */,
@@ -1507,7 +1068,6 @@
 				A8F76C422D350A9600AA6E93 /* TSPurchaseManager.swift in Sources */,
 				60553FDD2D3B84E700BAAD7F /* UIScrollView+Ext.swift in Sources */,
 				A81CA4852D1582A600A3AAC8 /* UIButton+Ex.swift in Sources */,
-				606372E72D5705F4005C82CF /* MusicPlaylistContainerViewController.swift in Sources */,
 				A81CA47F2D15789C00A3AAC8 /* TSConfig.swift in Sources */,
 				A81CA49F2D1655CE00A3AAC8 /* UICollectionView+Ex.swift in Sources */,
 				A81CA4BA2D16B6E300A3AAC8 /* TSHomeCell.swift in Sources */,
@@ -1520,106 +1080,29 @@
 				A83946272D1D623800ABFF0D /* TSShareUsVC.swift in Sources */,
 				A81CA48B2D15843700A3AAC8 /* TSCommonTool.swift in Sources */,
 				A84C239A2D1E3A4300B61B55 /* GPVideoPlayerView.swift in Sources */,
-				60553F722D3B528A00BAAD7F /* PlayDetailListViewContoller.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 */,
 				A868577E2DF81A940089D222 /* TSDBActionInfoModel.swift in Sources */,
 				A86857B72DF9258D0089D222 /* TSAIUploadPhotoVC.swift in Sources */,
-				60553F7F2D3B528A00BAAD7F /* OperateTopView.swift in Sources */,
 				A86857822DF81AD40089D222 /* TSActionInfoModel.swift in Sources */,
-				60553F802D3B528A00BAAD7F /* PlayDetailViewController+Ext.swift in Sources */,
 				A86857B22DF921F90089D222 /* TSView.swift in Sources */,
-				60553F812D3B528A00BAAD7F /* SJIJKMediaPlayer.m in Sources */,
-				60553F832D3B528A00BAAD7F /* THUD+CW.swift in Sources */,
-				60553F842D3B528A00BAAD7F /* SongListManageViewModel.swift in Sources */,
-				60553F852D3B528A00BAAD7F /* SongDownloadCellViewModel.swift in Sources */,
-				60553F862D3B528A00BAAD7F /* PlayDetailControlView.swift in Sources */,
 				A86857872DF81B660089D222 /* TSNetWork+Business.swift in Sources */,
 				A86857882DF81B660089D222 /* TSNetworkManager.swift in Sources */,
 				A86857892DF81B660089D222 /* TSNetworkManager+Loading.swift in Sources */,
-				60553F872D3B528A00BAAD7F /* PlayDetailListViewModel.swift in Sources */,
 				A86857A32DF91F690089D222 /* TSAILIstCell.swift in Sources */,
-				60553F892D3B528A00BAAD7F /* CWOperateViewController.swift in Sources */,
-				60553F8A2D3B528A00BAAD7F /* THUDProtocol.swift in Sources */,
-				60553F8B2D3B528A00BAAD7F /* THUD.swift in Sources */,
 				A868577C2DF819BB0089D222 /* TSDBManager.swift in Sources */,
-				60553F8C2D3B528A00BAAD7F /* PlayDetailViewController.swift in Sources */,
-				60553F8D2D3B528A00BAAD7F /* CWCustomProgressView.swift in Sources */,
-				60553F8E2D3B528A00BAAD7F /* PlaylistDetailViewController.swift in Sources */,
-				60553F8F2D3B528A00BAAD7F /* SleepTimeViewController.swift in Sources */,
 				A86857BE2DF926220089D222 /* TSAIListHistoryCell.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 */,
-				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 */,
-				60553F9B2D3B528A00BAAD7F /* LWSearchBar.swift in Sources */,
-				60553F9C2D3B528A00BAAD7F /* BubbleMenuView.swift in Sources */,
-				60553F9D2D3B528A00BAAD7F /* SongListViewModel.swift in Sources */,
 				A86857DD2DF99C200089D222 /* TSImageIPanComparisonView.swift in Sources */,
-				60553F9F2D3B528A00BAAD7F /* FilterBarView.swift in Sources */,
-				60553FA02D3B528A00BAAD7F /* SongListViewController+Target.swift in Sources */,
-				60553FA12D3B528A00BAAD7F /* ToastView.swift in Sources */,
 				A86857D32DF978740089D222 /* TSProgressState.swift in Sources */,
 				A868579A2DF915950089D222 /* TSPurchaseEnum.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 */,
 				A86857B92DF925A20089D222 /* TSAIList+Enmu.swift in Sources */,
-				60553FAC2D3B528A00BAAD7F /* TagListView.swift in Sources */,
-				60553FAD2D3B528A00BAAD7F /* ImageTextControl.swift in Sources */,
-				60553FAE2D3B528A00BAAD7F /* CWProgressView.swift in Sources */,
-				60553FAF2D3B528A00BAAD7F /* TipsView.swift in Sources */,
 				A86857DA2DF994600089D222 /* TSAIPhotoDetailsVC.swift in Sources */,
-				60553FB02D3B528A00BAAD7F /* PlayMiniBar.swift in Sources */,
 				A86857CF2DF977640089D222 /* TSAIListPhotoGeneratorVC.swift in Sources */,
-				60553FB12D3B528A00BAAD7F /* SongDownloadCell.swift in Sources */,
-				60553FB22D3B528A00BAAD7F /* LocalSearchViewModel.swift in Sources */,
 				A86857922DF845F60089D222 /* TSGeneratoringAnimationView.swift in Sources */,
 				A86857BC2DF926110089D222 /* TSAIListHistoryVC.swift in Sources */,
 				A86857932DF845F60089D222 /* TSGeneratorErrorView.swift in Sources */,
 				A86857C02DF926870089D222 /* TSPageNullView.swift in Sources */,
 				A86857942DF845F60089D222 /* TSGeneratorView.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 */,
-				60553FBD2D3B528A00BAAD7F /* SpacedButton.swift in Sources */,
 				A868578C2DF843F90089D222 /* TSRealmManager.swift in Sources */,
-				60553FBE2D3B528A00BAAD7F /* BasePresentViewController.swift in Sources */,
-				60553FBF2D3B528A00BAAD7F /* PlayListCell.swift in Sources */,
-				60553FC12D3B528A00BAAD7F /* MusicSearchBar.swift in Sources */,
-				60553FC22D3B528A00BAAD7F /* PlayerManager.swift in Sources */,
-				60553FC32D3B528A00BAAD7F /* LocalSearchViewController.swift in Sources */,
 				A84C239B2D1E3A4300B61B55 /* GPVideoClipperController.swift in Sources */,
-				60553FE32D3DF12200BAAD7F /* CustomSegementItem.swift in Sources */,
 				A84C239C2D1E3A4300B61B55 /* GPVideoClipperView.swift in Sources */,
 				A84C239D2D1E3A4300B61B55 /* GPVideoConfigMaker.swift in Sources */,
 				A839463C2D1D6E3600ABFF0D /* TSRandomWallpaperCopyrightVC.swift in Sources */,
@@ -1653,6 +1136,7 @@
 				A8C4C0AB2D2427E7003C46FC /* LivePhotoConverter.swift in Sources */,
 				A81F5B3C2D19087100740085 /* TSRandomWallpaperCell.swift in Sources */,
 				A81F5B442D19559C00740085 /* EditorVideoControlViewCell.swift in Sources */,
+				603901612DFFF0330096551E /* SpacedButton.swift in Sources */,
 				A81F5B452D19559C00740085 /* EditorVideoControlView.swift in Sources */,
 				A81F5B3E2D19088100740085 /* TSRandomWallpaperBannerCell.swift in Sources */,
 				A81CA4A42D16748800A3AAC8 /* TSViewTool.swift in Sources */,

+ 1 - 33
TSLiveWallpaper/AppDelegate.swift

@@ -6,7 +6,6 @@
 //
 
 import StoreKit
-import TSVideoKit
 import UIKit
 import Kingfisher
 @main
@@ -18,9 +17,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
         window?.backgroundColor = UIColor.black
         window?.makeKeyAndVisible()
         goToLoadVC()
-        initBaseDatas()
         initPlatform()
-        downloadNotifaction()
         return true
     }
 
@@ -34,42 +31,13 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
         
     }
 
-    func initBaseDatas() {
-        var config = TSConfiguration.default
-        config.configurePath = "http://p.100yearslater.com/live/config"
-        TSVideoOperator.shared.loadWithConfiguration(config: config, needJs: false)
 
-        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)
-    }
 
     func applicationDidBecomeActive(_ application: UIApplication) {
     }
 
     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) {

BIN
TSLiveWallpaper/Assets.xcassets/Purchase/.DS_Store


+ 0 - 2
TSLiveWallpaper/Business/TSAIListVC/TSAIListVC/TSAIListVC.swift

@@ -171,8 +171,6 @@ class TSAIListVC: TSBaseVC {
         collectionView.snp.makeConstraints { make in
             make.edges.equalToSuperview()
         }
-        
-        PlayerManager.shared.miniBar.isHidden = true
     }
     
     override func dealThings() {

+ 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.cornerRadius = 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.cornerRadius = 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.cornerRadius = 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)
-        cornerRadius = 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.cornerRadius = 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
-        
-        cornerRadius = 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 - 464
TSLiveWallpaper/Business/TSMusic/Detail/Controller/PlayDetailViewController.swift

@@ -1,464 +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.cornerRadius = 20
-        btn.isHidden = true
-        return btn
-    }()
-
-    lazy var topView: PlayDetailTopView = PlayDetailTopView()
-    lazy var controlView: PlayDetailControlView = PlayDetailControlView()
-    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()
-        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) {
-      
-    }
-
-    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)
-            } 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()
-            }
-        }
-    }
-
-
-
-    @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) {
-      
-    }
-
-    // 调用这个方法来显示加载圈
-    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 - 210
TSLiveWallpaper/Business/TSMusic/Detail/PlayerManager.swift

@@ -1,210 +0,0 @@
-//
-//  PlayRootManager.swift
-//  ColorfulWallpaper
-//
-//  Created by nkl on 2024/9/13.
-//
-
-// 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
-        }
-        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) {
-        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 - 49
TSLiveWallpaper/Business/TSMusic/Detail/View/PlayButtonView.swift

@@ -1,49 +0,0 @@
-//
-//  PlayButtonView.swift
-//  ColorfulWallpaper
-//
-//  Created by nkl on 2024/9/13.
-//
-
-import Foundation
-import UIKit
-
-enum PlayState {
-    case pause
-    case playing
-}
-
-class PlayButtonView: UIControl {
-    var playingState: PlayState = .pause {
-        didSet {
-            if playingState == .pause {
-                iconView.image = UIImage(named: "ic_detail_playBtn")
-            } else {
-                iconView.image = UIImage(named: "ic_detail_pauseBtn")
-            }
-        }
-    }
-
-    lazy var iconView: UIImageView = .init(image: UIImage(named: "ic_detail_playBtn"))
-
-    override init(frame: CGRect) {
-        super.init(frame: frame)
-        addChildren()
-        makeConstraints()
-    }
-
-    func addChildren() {
-        addSubview(iconView)
-    }
-
-    func makeConstraints() {
-        iconView.contentMode = .scaleAspectFit
-        iconView.snp.makeConstraints { make in
-            make.edges.equalToSuperview()
-        }
-    }
-
-    required init?(coder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-}

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

@@ -1,267 +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
-        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 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.cornerRadius = 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 - 59
TSLiveWallpaper/Business/TSMusic/Helper/CWOperateButton.swift

@@ -1,59 +0,0 @@
-//
-//  CWOperateButton.swift
-//  ColorfulWallpaper
-//
-//  Created by nkl on 2024/9/23.
-//
-
-import Foundation
-import UIKit
-
-class CWOperateButton : UIControl {
-    
-    lazy var bgView : UIView = .simpleView(color: .white.withAlphaComponent(0.1))
-    
-    lazy var iconView : UIImageView = .simpleImage(imageName: "icon_delete")
-    
-    lazy var titleLabel : UILabel = .simpleLabel(text: "Delete".localized(),font: .systemFont12,color: .white)
-    
-    
-    init(title:String,imgName:String) {
-        super.init(frame: .zero)
-        self.iconView.image = UIImage.init(named: imgName)
-        self.titleLabel.text = title
-        self.titleLabel.textAlignment = .center
-        bgView.isUserInteractionEnabled = false
-        addChildren()
-        makeConstraints()
-    }
-    
-    func addChildren(){
-        bgView.cornerRadius = 16
-        addSubview(bgView)
-        bgView.addSubview(iconView)
-        addSubview(titleLabel)
-    }
-    
-    func makeConstraints(){
-        bgView.snp.makeConstraints { make in
-            make.top.equalToSuperview()
-            make.centerX.equalToSuperview()
-            make.height.width.equalTo(48)
-        }
-        
-        iconView.snp.makeConstraints { make in
-            make.center.equalTo(bgView)
-        }
-        
-        titleLabel.snp.makeConstraints { make in
-            make.leading.trailing.equalToSuperview()
-            make.width.greaterThanOrEqualTo(48)
-            make.bottom.equalToSuperview()
-            make.top.equalTo(bgView.snp.bottom).offset(8)
-        }
-    }
-    
-    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\(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 - 181
TSLiveWallpaper/Business/TSMusic/Helper/DownloadButton.swift

@@ -1,181 +0,0 @@
-//
-//  DownloadButton.swift
-//  ColorfulWallpaper
-//
-//  Created by nkl on 2024/9/10.
-//
-
-import Foundation
-import Kingfisher
-
-enum DownloadButtonState {
-    case idle(isAnimate: Bool)
-    case loading
-    case downloading
-    case pause
-    case retry
-    case done
-
-    var imageName: String {
-        switch self {
-        case let .idle(isAnimate):
-            if isAnimate {
-                return "download"
-            } else {
-                return "ic_download"
-            }
-        case .loading:
-            return ""
-        case .downloading:
-            return ""
-        case .pause:
-            return "ic_download_pause"
-        case .retry:
-            return "ic_retry"
-        case .done:
-            return "icon_more"
-        }
-    }
-}
-
-class DownloadButton: UIControl {
-    
-    lazy var adTag: UIImageView = {
-        let tag = UIImageView(image: UIImage(named: "ic_tag"))
-        tag.isHidden = false
-        return tag
-    }()
-    
-    /// 下载状态
-    var downloadState: DownloadButtonState = .idle(isAnimate: false) {
-        didSet {
-            setStateForButton()
-        }
-    }
-
-    lazy var loadingView: UIImageView = {
-        let img = UIImageView(image: UIImage(named: "ic-rotate-loading"))
-        img.isHidden = true
-        return img
-    }()
-
-    /// 进度条
-    lazy var progressView: CWCustomProgressView = {
-        let progress = CWCustomProgressView()
-        progress.isHidden = true
-        progress.isUserInteractionEnabled = false
-        return progress
-    }()
-
-    lazy var stateImageView: AnimatedImageView = AnimatedImageView()
-
-    override init(frame: CGRect) {
-        super.init(frame: frame)
-        addChildren()
-        makeConstraints()
-    }
-
-    func addChildren() {
-        addSubview(progressView)
-        addSubview(stateImageView)
-        addSubview(loadingView)
-        addSubview(adTag)
-    }
-
-    func makeConstraints() {
-        
-        adTag.snp.makeConstraints { make in
-            make.centerX.equalToSuperview().offset(13)
-            make.centerY.equalToSuperview().offset(-10)
-            make.width.equalTo(14.4)
-            make.height.equalTo(12)
-        }
-        
-        progressView.snp.makeConstraints { make in
-            make.center.equalToSuperview()
-            make.width.height.equalTo(40)
-        }
-
-        stateImageView.snp.makeConstraints { make in
-            make.center.equalToSuperview()
-            make.width.height.equalTo(24)
-        }
-
-        loadingView.snp.makeConstraints { make in
-            make.center.equalToSuperview()
-        }
-    }
-
-    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
-        loadingView.layer.add(animation, forKey: nil) // 给需要旋转的view增加动画
-    }
-
-    func setStateForButton() {
-        stateImageView.setLocalizedImage(UIImage.init(named: downloadState.imageName))
-        stateImageView.snp.updateConstraints { make in
-            make.width.height.equalTo(24)
-        }
-        switch downloadState {
-        case let .idle(animate):
-            if !animate {
-                stateImageView.setLocalizedImage(UIImage.init(named: downloadState.imageName))
-                stateImageView.snp.updateConstraints { make in
-                    make.width.height.equalTo(24)
-                }
-            }else{
-//                let path = Bundle.main.path(forResource:downloadState.imageName, ofType:"gif")
-//                let url = URL(fileURLWithPath: path!)
-//                let resource = Kingfisher.KF.ImageResource(downloadURL: url)
-//                stateImageView.kf.setImage(with: resource)
-//                stateImageView.snp.updateConstraints { make in
-//                    make.width.height.equalTo(24)
-//                }
-                stateImageView.setLocalizedImage(UIImage.init(named: downloadState.imageName))
-                stateImageView.snp.updateConstraints { make in
-                    make.width.height.equalTo(24)
-                }
-            }
-            progressView.isHidden = true
-            loadingView.isHidden = true
-            adTag.isHidden = PurchaseManager.default.isVip
-        case .loading:
-            adTag.isHidden = true
-            progressView.isHidden = true
-            loadingView.isHidden = false
-            startLoadingAnimation()
-        case .downloading:
-            adTag.isHidden = true
-            progressView.isHidden = false
-            progressView.progressTitle.isHidden = false
-            loadingView.isHidden = true
-        case .pause:
-            adTag.isHidden = true
-            progressView.isHidden = true
-            progressView.progressTitle.isHidden = true
-            loadingView.isHidden = true
-        case .retry:
-            adTag.isHidden = true
-            progressView.isHidden = true
-            loadingView.isHidden = true
-        case .done:
-            adTag.isHidden = true
-            progressView.isHidden = true
-            loadingView.isHidden = true
-        }
-    }
-
-    required init?(coder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-}

+ 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.cornerRadius = 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 - 126
TSLiveWallpaper/Business/TSMusic/List/Controller/MusicHomeContainerViewController.swift

@@ -1,126 +0,0 @@
-//
-//  MusicContainerViewController.swift
-//  DiaryWallPaper
-//
-//  Created by 倪锴伦 on 2025/1/20.
-//
-
-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()
-    }
-
-    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() {
-        let vc = LocalSearchViewController()
-        vc.hidesBottomBarWhenPushed = true
-        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 - 131
TSLiveWallpaper/Business/TSMusic/List/Controller/MusicPlaylistContainerViewController.swift

@@ -1,131 +0,0 @@
-//
-//  MusicContainerViewController.swift
-//  DiaryWallPaper
-//
-//  Created by 倪锴伦 on 2025/1/20.
-//
-
-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()
-    }
-
-    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() {
-        let vc = LocalSearchViewController()
-        vc.hidesBottomBarWhenPushed = true
-        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 - 24
TSLiveWallpaper/Business/TSMusic/List/Controller/SongListViewController+Target.swift

@@ -1,24 +0,0 @@
-//
-//  MusicEmptyView.swift
-//  PhysicalWallPaper
-//
-//  Created by nkl on 2024/11/13.
-//
-
-// import ADManager
-import Foundation
-import TSVideoKit
-
-extension SongListViewController {
-    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)
-        }
-    }
-}

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

@@ -1,251 +0,0 @@
-//
-//  MusicEmptyView.swift
-//  PhysicalWallPaper
-//
-//  Created by nkl on 2024/11/13.
-//
-
-import BetterSegmentedControl
-import Combine
-import Foundation
-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.cornerRadius = 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()
-
-    }
-
-    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 {
-
-        } 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() {
-        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 - 56
TSLiveWallpaper/Business/TSMusic/List/View/CWTopCustomButton.swift

@@ -1,56 +0,0 @@
-//
-//  MusicEmptyView.swift
-//  PhysicalWallPaper
-//
-//  Created by nkl on 2024/11/13.
-//
-
-import Foundation
-import UIKit
-
-class CWTopCustomButton: UIControl {
-    lazy var iconView: UIImageView = .init(image: UIImage(named: "icon_mine_favourite"))
-    lazy var titleLabel: UILabel = .simpleLabel(text: "Like".localized(), font: .systemFont16, color: .white.withAlphaComponent(0.8))
-    lazy var countLabel: UILabel = .simpleLabel(text: "0", font: .systemFont14, color: .white.withAlphaComponent(0.4))
-
-    init(iconName: String, title: String) {
-        super.init(frame: .zero)
-        backgroundColor = .white.withAlphaComponent(0.1)
-        layer.cornerRadius = 16
-        iconView.image = UIImage(named: iconName)
-        iconView.clipsToBounds = true
-        titleLabel.text = title
-        addChildren()
-        makeConstraints()
-    }
-
-    func addChildren() {
-        addSubview(iconView)
-        addSubview(titleLabel)
-        addSubview(countLabel)
-    }
-
-    func makeConstraints() {
-        iconView.snp.makeConstraints { make in
-            make.leading.equalToSuperview().offset(12)
-            make.centerY.equalToSuperview()
-            make.width.height.equalTo(60)
-        }
-
-        titleLabel.snp.makeConstraints { make in
-            make.top.equalTo(iconView.snp.top).offset(5)
-            make.leading.equalTo(iconView.snp.trailing).offset(12)
-            make.trailing.equalToSuperview().offset(-12)
-        }
-
-        countLabel.snp.makeConstraints { make in
-            make.bottom.equalTo(iconView.snp.bottom).offset(-5)
-            make.leading.equalTo(iconView.snp.trailing).offset(12)
-            make.trailing.equalToSuperview().offset(-12)
-        }
-    }
-
-    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 - 176
TSLiveWallpaper/Business/TSMusic/List/View/SongDownloadCell.swift

@@ -1,176 +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.cornerRadius = 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 ?? ""
-        }
-
-
-        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
-        }
-    }
-
-    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))
-    }
-
-    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")
-    }
-}

+ 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.cornerRadius = 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.cornerRadius = 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 - 24
TSLiveWallpaper/Business/TSMusic/List/ViewModel/SongDownloadCellViewModel.swift

@@ -1,24 +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)
-
-    var dataModel: VideoOnlineModel?
-    var dataVideo: TSVideo?
-
-    private var cancellables: Set<AnyCancellable> = []
-
-    init(dataModel: VideoOnlineModel?, video: TSVideo?) {
-        self.dataModel = dataModel
-        dataVideo = video
-    }
-}

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

@@ -1,155 +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 {
-//         
-        } 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 - 0
TSLiveWallpaper/Business/TSMusic/Custom/SpacedButton.swift → TSLiveWallpaper/Business/TSMusic/MusicBase/SpacedButton.swift


+ 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 - 611
TSLiveWallpaper/Business/TSMusic/OC/IJKPlayer/Core/SJIJKMediaPlayer.m

@@ -1,611 +0,0 @@
-//
-//  SJIJKMediaPlayer.m
-//  SJBaseVideoPlayer.common-IJKPlayer
-//
-//  Created by 畅三江 on 2022/8/15.
-//
-#import "IJKMediaFramework/IJKMediaFramework.h"
-#import "SJIJKMediaPlayer.h"
-#import "IJKMediaFramework/IJKMediaFramework.h"
-#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 - 88
TSLiveWallpaper/Business/TSMusic/OC/IJKPlayer/SJIJKMediaPlaybackController.m

@@ -1,88 +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"
-#import "IJKMediaFramework/IJKMediaPlayer.h"
-
-#if __has_include(<SJUIKit/SJRunLoopTaskQueue.h>)
-#import <SJUIKit/SJRunLoopTaskQueue.h>
-#else
-#import "SJRunLoopTaskQueue.h"
-#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.cornerRadius = 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 - 355
TSLiveWallpaper/Business/TSMusic/PlayList/Controller/PlaylistDetailViewController.swift

@@ -1,355 +0,0 @@
-//
-//  PlaylistDetailViewController.swift
-//  ColorfulWallpaper
-//
-//  Created by ni on 2024/9/19.
-//
-
-import Combine
-import Foundation
-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.cornerRadius = 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.cornerRadius = 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 - 128
TSLiveWallpaper/Business/TSMusic/PlayList/Controller/PlaylistViewController.swift

@@ -1,128 +0,0 @@
-//
-//  PlaylistViewController.swift
-//  ColorfulWallpaper
-//
-//  Created by ni on 2024/9/18.
-//
-
-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 {
-            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.cornerRadius = 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.cornerRadius = 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.cornerRadius = 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.cornerRadius = 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 - 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()
-    }
-}

+ 0 - 55
TSLiveWallpaper/Business/TSMusic/Search/Views/CWSearchTextBar.swift

@@ -1,55 +0,0 @@
-//
-//  CWSearchTextBar.swift
-//  ColorfulWallpaper
-//
-//  Created by nkl on 2024/9/11.
-//
-
-import Foundation
-import UIKit
-
-class CWSearchTextBar: UIView {
-    lazy var searchView: UIView = {
-        let v = UIView()
-        v.backgroundColor = .white.withAlphaComponent(0.1)
-        v.layer.cornerRadius = 12
-        v.layer.masksToBounds = true
-        return v
-    }()
-
-    lazy var textFiled: CustomTextField = {
-        let text = CustomTextField()
-        text.textAlignment = FitManager.isAr ? .right : .left
-        text.tintColor = .white
-        text.textColor = .white
-        text.clearButtonMode = .always
-        return text
-    }()
-
-    override init(frame: CGRect) {
-        super.init(frame: frame)
-        addChildren()
-        makeCOnstraints()
-    }
-
-    func addChildren() {
-        addSubview(searchView)
-        searchView.addSubview(textFiled)
-    }
-
-    func makeCOnstraints() {
-        searchView.snp.makeConstraints { make in
-            make.edges.equalToSuperview()
-        }
-
-        textFiled.snp.makeConstraints { make in
-            make.leading.equalToSuperview().offset(12)
-            make.trailing.equalToSuperview()
-            make.centerY.equalToSuperview()
-        }
-    }
-
-    required init?(coder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-}

+ 0 - 22
TSLiveWallpaper/Business/TSMusic/Search/Views/CustomTextField.swift

@@ -1,22 +0,0 @@
-//
-//  CustomTextField.swift
-//  ColorfulWallpaper
-//
-//  Created by nkl on 2024/9/10.
-//
-
-import Foundation
-import UIKit
-
-class CustomTextField: UITextField {
-    override func layoutSubviews() {
-        super.layoutSubviews()
-
-        for view in subviews {
-            if let button = view as? UIButton {
-                button.setImage(button.image(for: .normal)?.withRenderingMode(.alwaysTemplate), for: .normal)
-                button.tintColor = .white.withAlphaComponent(0.4)
-            }
-        }
-    }
-}

+ 0 - 59
TSLiveWallpaper/Business/TSMusic/Search/Views/LWSearchBar.swift

@@ -1,59 +0,0 @@
-//
-//  CWSearchBar.swift
-//  ColorfulWallpaper
-//
-//  Created by nkl on 2024/9/10.
-//
-
-import Foundation
-import UIKit
-import Localize_Swift
-import KLExtension
-
-class LWSearchBar: UIControl {
-    lazy var searchView: UIView = {
-        let v = UIView()
-        v.backgroundColor = .white
-        v.layer.cornerRadius = 20
-        v.layer.masksToBounds = true
-        v.isUserInteractionEnabled = false
-        return v
-    }()
-
-    lazy var iconView: UIImageView = .init(image: UIImage(named: "icon_search"))
-
-    lazy var titleLabel: UILabel = .simpleLabel(text: "Search Music".localized(),font: .systemFont14,color: .hexColor("#A8ACAF"))
-
-    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.edges.equalToSuperview()
-        }
-        iconView.snp.makeConstraints { make in
-            make.leading.equalToSuperview().offset(16)
-            make.centerY.equalToSuperview()
-            make.width.height.equalTo(24)
-        }
-
-        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 - 51
TSLiveWallpaper/Business/TSMusic/Search/Views/RelateSeachCell.swift

@@ -1,51 +0,0 @@
-//
-//  RelateSeachCell.swift
-//  ColorfulWallpaper
-//
-//  Created by nkl on 2024/9/11.
-//
-
-import Foundation
-import UIKit
-
-class RelateSeachCell : UITableViewCell {
-    
-    lazy var searchIcon : UIImageView = UIImageView.init(image: .iconSearch)
-    
-    lazy var keywordLabel : UILabel = {
-       let lab = UILabel()
-        lab.textColor = .white
-        return lab
-    }()
-    
-    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
-        super.init(style: style, reuseIdentifier: reuseIdentifier)
-        backgroundColor = .clear
-        selectionStyle = .none
-        addChildren()
-        makeConstraints()
-    }
-
-    func addChildren(){
-        contentView.addSubview(searchIcon)
-        contentView.addSubview(keywordLabel)
-    }
-    
-    func makeConstraints(){
-        searchIcon.snp.makeConstraints { make in
-            make.width.height.equalTo(16)
-            make.leading.equalToSuperview().offset(16)
-            make.centerY.equalToSuperview()
-        }
-        keywordLabel.snp.makeConstraints { make in
-            make.leading.equalTo(searchIcon.snp.trailing).offset(12)
-            make.trailing.equalToSuperview().inset(16)
-            make.verticalEdges.equalToSuperview().inset(10)
-        }
-    }
-    
-    required init?(coder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-    
-}

+ 0 - 230
TSLiveWallpaper/Business/TSMusic/Search/Views/TagListView.swift

@@ -1,230 +0,0 @@
-//
-//  TagListView.swift
-//  ColorfulWallpaper
-//
-//  Created by nkl on 2024/9/11.
-//
-
-import Foundation
-import KLExtension
-import SwiftUI
-let kStore_History_Key = "Historys"
-
-public struct HistoryModel: Codable {
-    var keyword: String
-    var id: String
-    var date: Date
-}
-
-class HistoryViewModel: ObservableObject {
-    @Published var historys: [HistoryModel] = []
-
-    init() {
-        requestData()
-    }
-
-    func requestData() {
-        let storage = CodableStorage()
-        do {
-            let historys: [HistoryModel] = try storage.fetch(for: kStore_History_Key)
-            let result: [HistoryModel] = Array(historys.sorted(by: { $0.date > $1.date })
-                .prefix(20))
-            self.historys = result
-        } catch {
-            historys = []
-        }
-    }
-
-    func deleteHistory(id: String) {
-        let storage = CodableStorage()
-        do {
-            var historys: [HistoryModel] = try storage.fetch(for: kStore_History_Key)
-            historys.removeAll {
-                $0.id == id
-            }
-            try storage.save(historys, for: kStore_History_Key)
-            self.historys = historys
-        } catch {
-            historys = []
-        }
-    }
-
-    func deleteAllHistorys() {
-        let storage = CodableStorage()
-        do {
-            let tmp: [HistoryModel] = []
-            try storage.save(tmp, for: kStore_History_Key)
-            historys = []
-        } catch {
-            historys = []
-        }
-    }
-}
-
-struct TagListView: View {
-    var selectedHistoryTag: (HistoryModel) -> Void = { _ in }
-
-    @ObservedObject var history: HistoryViewModel = .init()
-
-    @State var isEditing: Bool = false
-
-    var body: some View {
-        VStack {
-            if !history.historys.isEmpty {
-                HStack {
-                    Text("History".localized())
-                        .foregroundColor(.white)
-                        .font(.system(size: 16).bold())
-                    Spacer()
-                    HStack {
-                        if isEditing {
-                            HStack {
-                                Text("Delete all".localized())
-                                    .font(.system(size: 12))
-                                    .foregroundColor(.white.opacity(0.6))
-                                    .onTapGesture {
-                                        history.deleteAllHistorys()
-                                    }
-
-                                Rectangle().frame(width: 1, height: 12)
-                                    .foregroundColor(Color.white.opacity(0.6))
-
-                                Text("Cancel".localized())
-                                    .font(.system(size: 12))
-                                    .foregroundColor(.red)
-                                    .onTapGesture {
-                                        isEditing = false
-                                    }
-                            }
-                        } else {
-                            Image("ic_history_clear")
-                                .onTapGesture {
-                                    isEditing = true
-                                }
-                        }
-                    }
-                }
-                .padding(.horizontal, 16)
-                .padding(.top, 30)
-            }
-            GeometryReader { geometry in
-                TagLayoutView(
-                    history.historys,
-                    tagFont: UIFont.systemFont(ofSize: 12),
-                    padding: 24,
-                    parentWidth: geometry.size.width) { tag in
-                        ZStack(alignment: .topTrailing) {
-                            Text(tag.keyword)
-                                .font(.system(size: 12))
-                                .fixedSize()
-                                .padding(EdgeInsets(top: 8, leading: 16, bottom: 8, trailing: 16))
-                                .foregroundColor(Color.white)
-                                .background(Color.white.opacity(0.1))
-                                .clipShape(.capsule)
-                            if isEditing {
-                                Image("ic-close")
-                                    .resizable()
-                                    .frame(width: 8, height: 8)
-                                    .padding(.trailing, 8)
-                                    .padding(.top, 8)
-
-                            }
-                        }
-                        .onTapGesture {
-                            if isEditing {
-                                history.deleteHistory(id: tag.id)
-                            } else {
-                                selectedHistoryTag(tag)
-                            }
-                        }
-                    }.padding(.horizontal, 16)
-            }
-        }.onAppear(perform: {
-            history.requestData()
-        })
-    }
-}
-
-#Preview(body: {
-    TagListView()
-})
-
-@available(iOS 13.0, *)
-public struct TagLayoutView<Content>: View where Content: View {
-    private let tags: [HistoryModel]
-    private var tagFont: UIFont
-    private let padding: CGFloat
-    private let parentWidth: CGFloat
-    private let content: (HistoryModel) -> Content
-    private var elementsCountByRow: [Int] = []
-
-    public init(_ tags: [HistoryModel],
-                tagFont: UIFont,
-                padding: CGFloat,
-                parentWidth: CGFloat,
-                content: @escaping (HistoryModel) -> Content) {
-        self.tags = tags
-        self.tagFont = tagFont
-        self.padding = padding
-        self.parentWidth = parentWidth
-        self.content = content
-        elementsCountByRow = getElementsCountByRow(self.parentWidth)
-    }
-
-    private func getElementsCountByRow(_ rowSize: CGFloat) -> [Int] {
-        let tagWidths = tags.map { $0.keyword.widthOfString(usingFont: self.tagFont) }
-
-        var currentRowTotalWidth: CGFloat = 0.0
-        var currentRowElementsCount: Int = 0
-        var result: [Int] = []
-
-        for tagWidth in tagWidths {
-            let fixedTagWidth = tagWidth + (2 * padding)
-            if currentRowTotalWidth + fixedTagWidth <= rowSize {
-                currentRowTotalWidth += fixedTagWidth
-                currentRowElementsCount += 1
-                guard result.count != 0 else { result.append(1); continue }
-                result[result.count - 1] = currentRowElementsCount
-            } else {
-                currentRowTotalWidth = fixedTagWidth
-                currentRowElementsCount = 1
-                result.append(1)
-            }
-        }
-        return result
-    }
-
-    private func getTag(elementsCountByRow: [Int], rowIndex: Int, elementIndex: Int) -> HistoryModel {
-        let sumOfPreviousRows = elementsCountByRow.enumerated().reduce(0) { total, next in
-            if next.offset < rowIndex {
-                return total + next.element
-            } else {
-                return total
-            }
-        }
-        let orderedTagsIndex = sumOfPreviousRows + elementIndex
-        guard tags.count > orderedTagsIndex else { return .init(keyword: "", id: "", date: Date()) }
-        return tags[orderedTagsIndex]
-    }
-
-    public var body: some View {
-        VStack(alignment: .leading, spacing: 0) {
-            ForEach(0 ..< self.elementsCountByRow.count, id: \.self) { rowIndex in
-                HStack {
-                    ForEach(0 ..< self.elementsCountByRow[rowIndex], id: \.self) { elementIndex in
-                        self.content(self.getTag(elementsCountByRow: self.elementsCountByRow, rowIndex: rowIndex, elementIndex: elementIndex))
-                    }
-                    Spacer()
-                }.padding(.vertical, 4)
-            }
-        }
-    }
-}
-
-extension String {
-    func widthOfString(usingFont font: UIFont) -> CGFloat {
-        let fontAttributes = [NSAttributedString.Key.font: font]
-        let size = self.size(withAttributes: fontAttributes)
-        return size.width
-    }
-}

+ 2 - 0
TSLiveWallpaper/Business/TSPurchaseMembershipVC/TSPurchaseVC.swift

@@ -8,6 +8,8 @@
 import Combine
 import SwiftUI
 import SwiftUIX
+import Localize_Swift
+
 class PurchaseViewModel : ObservableObject{
     
     @Published var selectedType: PremiumPeriod = .year//.lifetime

+ 1 - 153
TSLiveWallpaper/Business/TSTabBarController/TSTabBarController.swift

@@ -5,25 +5,15 @@
 //  Created by 100Years on 2024/12/20.
 //
 
-import TSVideoKit
 import UIKit
 
 class TSTabBarController: UITabBarController {
-    lazy var miniBar: PlayMiniBar = PlayMiniBar()
-    lazy var playerVc: PlayDetailViewController = .init()
-    lazy var multiSelectView: CWMutiSelectOpeateView = {
-        let mView = CWMutiSelectOpeateView()
-        mView.isHidden = true
-        mView.deleteButton.addTarget(self, action: #selector(deleteButtonAction), for: .touchUpInside)
-        mView.addPlaylist.addTarget(self, action: #selector(addToPlaylistAction), for: .touchUpInside)
-        return mView
-    }()
 
     private var viewControllerArray: [String] = []
     private var titleArray: [String] = []
     private var selectedImageArray: [String] = []
     private var unselectedImageArray: [String] = []
-    private let markWidth = k_ScreenWidth / 4
+    private let markWidth = k_ScreenWidth / 2
     private lazy var markView: UIView = {
         let bgView = UIView()
         let imageView = UIImageView.createImageView(imageName: "tabbar_select_mark")
@@ -41,26 +31,19 @@ class TSTabBarController: UITabBarController {
         delegate = self
         createUI()
         setUpData()
-        initExampleData()
     }
 
     @objc private func setUpData() {
         viewControllerArray = [
             "TSAIListVC",
-            "MusicHomeContainerViewController",
-            "MusicPlaylistContainerViewController",
             "TSMineVC"]
         
         selectedImageArray = [
             "tabbar_select_ailist",
-            "tabbar_select_music",
-            "tabbar_select_playlist",
             "tabbar_select_mine",
         ]
         unselectedImageArray = [
             "tabbar_unSelect_allist",
-            "tabbar_unSelect_music",
-            "tabbar_unSelect_playlist",
             "tabbar_unSelect_mine",
         ]
 
@@ -104,12 +87,6 @@ class TSTabBarController: UITabBarController {
             make.width.equalTo(markWidth)
             make.height.equalTo(8)
         }
-
-        addMusicAndMiniBar()
-        kMainShort {
-            self.updateMiniBarHidden()
-        }
-        
     }
 
     func updateMarkViewFrame() {
@@ -138,141 +115,12 @@ class TSTabBarController: UITabBarController {
         NotificationCenter.default.removeObserver(self)
     }
 
-    func initExampleData() {
-        if UserDefaults.standard.string(forKey: "InitExampleData") == nil {
-            if let path = Bundle.main.path(forResource: "Example Music", ofType: ".mp3") {
-                let fileUrl = URL(fileURLWithPath: path)
-                ExampleIniter.default.copyFileToUrl(url: fileUrl)
-                UserDefaults.standard.set("1", forKey: "InitExampleData")
-            }
-
-            DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
-                if let firstVideo = TSVideoOperator.shared.dataManager.fetchAllVideos().first {
-                    TSVideoOperator.shared.playerViewModel.currentVideo = firstVideo
-                    PlayerManager.shared.miniBar.updateVideoInfo(video: firstVideo, state: .pause)
-                }
-            }
-        }
-    }
 }
 
 extension TSTabBarController: UITabBarControllerDelegate {
     func tabBarController(_ tabBarController: UITabBarController, didSelect viewController: UIViewController) {
-        updateMiniBarHidden()
         updateMarkViewFrame()
     }
-    
-    func updateMiniBarHidden(){
-        PlayerManager.shared.miniBar.isHidden = (selectedIndex == 0 || selectedIndex == 3)
-    }
-}
-
-// MARK: 音乐布局相关
-
-extension TSTabBarController {
-    private func addMusicAndMiniBar() {
-        let tap = UITapGestureRecognizer(target: self, action: #selector(showPlayDetailVc))
-        miniBar.bgImageView.addGestureRecognizer(tap)
-        miniBar.layer.cornerRadius = 16
-        miniBar.layer.masksToBounds = true
-        view.addSubview(miniBar)
-        view.addSubview(playerVc.view)
-        view.addSubview(multiSelectView)
-        view.bringSubviewToFront(multiSelectView)
-        makeMusicConstraints()
-    }
-
-    private func makeMusicConstraints() {
-        miniBar.snp.makeConstraints { make in
-            make.bottom.equalToSuperview().offset(-UIDevice.tabBarHeight)
-            make.leading.equalToSuperview().offset(10)
-            make.trailing.equalToSuperview().offset(-10)
-            make.height.equalTo(62)
-        }
-
-        playerVc.view.snp.makeConstraints { make in
-            make.top.equalTo(view.snp.bottom)
-            make.leading.trailing.equalToSuperview()
-            make.height.equalTo(UIScreen.kScreenHeight)
-        }
-
-        multiSelectView.snp.makeConstraints { make in
-            make.bottom.equalToSuperview()
-            make.leading.trailing.equalToSuperview()
-            make.height.equalTo(k_Height_TabBar + 62)
-        }
-    }
-
-    func moveDownMiniBar() {
-        miniBar.snp.remakeConstraints { make in
-            make.bottom.equalTo(view.safeAreaLayoutGuide.snp.bottom)
-            make.leading.equalToSuperview().offset(10)
-            make.trailing.equalToSuperview().offset(-10)
-            make.height.equalTo(62)
-        }
-    }
-
-    func moveUpMiniBar() {
-        miniBar.snp.remakeConstraints { make in
-            make.bottom.equalToSuperview().offset(-UIDevice.tabBarHeight)
-            make.leading.equalToSuperview().offset(10)
-            make.trailing.equalToSuperview().offset(-10)
-            make.height.equalTo(62)
-        }
-    }
-}
-
-// MARK: 音乐操作相关
-
-extension TSTabBarController {
-    func showMultiSelectView() {
-        multiSelectView.isHidden = false
-        view.bringSubviewToFront(multiSelectView)
-    }
-
-    func hideMultiSelectView() {
-        multiSelectView.isHidden = true
-        view.bringSubviewToFront(multiSelectView)
-    }
-
-    @objc func deleteButtonAction() {
-        PlayerManager.shared.deleteSelectedVideos()
-    }
-
-    @objc func addToPlaylistAction() {
-        PlayerManager.shared.addVideosToPlaylist()
-    }
-
-    @objc func showPlayDetailVc() {
-        showPlayerVc()
-    }
-
-    func showPlayerVc() {
-//        ADManager.shared.prepareAd(scenes: [ADScene.downloadReward])
-        UIView.animate(withDuration: 0.2) {
-            self.playerVc.view.snp.remakeConstraints { make in
-                make.top.equalToSuperview()
-                make.leading.trailing.equalToSuperview()
-                make.height.equalTo(UIScreen.kScreenHeight)
-            }
-            self.view.setNeedsLayout()
-            self.view.layoutIfNeeded()
-            self.view.bringSubviewToFront(self.playerVc.view)
-        }
-    }
-
-    func hidePlayerVc() {
-        UIView.animate(withDuration: 0.2) {
-            self.playerVc.view.snp.remakeConstraints { make in
-                make.top.equalToSuperview().offset(UIScreen.kScreenHeight)
-                make.leading.trailing.equalToSuperview()
-                make.height.equalTo(UIScreen.kScreenHeight)
-            }
-            self.view.setNeedsLayout()
-            self.view.layoutIfNeeded()
-            self.view.bringSubviewToFront(self.playerVc.view)
-        }
-    }
 }
 
 // MARK: 进到首页后需要做的处理

+ 0 - 15
TSLiveWallpaper/LaunchVC/TSLaunchVC.swift

@@ -6,7 +6,6 @@
 //
 
 import Alamofire
-import TSVideoKit
 import UIKit
 import AppTrackingTransparency
 
@@ -33,20 +32,6 @@ class TSLaunchVC: UIViewController {
         setupLaunchScreenView()
         startTimer()
         kPurchaseBusiness.launchPrchase()
-        addNotifiy()
-    }
-
-
-    func addNotifiy() {
-        TSNetworkShard.startListenNetStatus { status, manager in
-            switch status {
-            case .reachable:
-                kPurchaseBusiness.launchPrchase()
-                manager?.stopListening()
-            default:
-                break
-            }
-        }
     }
 
     func enterApp() {

BIN
TSLiveWallpaper/Resource/Example/Example Music.mp3


+ 0 - 76
TSLiveWallpaper/Resource/Example/ExampleIniter.swift

@@ -1,76 +0,0 @@
-//
-//  ExampleIniter.swift
-//  TSLiveWallpaper
-//
-//  Created by nkl on 2025/2/6.
-//
-
-import Foundation
-import TSVideoKit
-
-class ExampleIniter {
-    static let `default` = ExampleIniter()
-
-    private 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 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(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: kDataChangedNotifactionName, object: nil)
-            }
-        }
-    }
-}