diff --git a/Podfile b/Podfile index 400e2e5..671ec91 100644 --- a/Podfile +++ b/Podfile @@ -29,4 +29,6 @@ pod "DownloadButton" pod 'Tiercel' #文本跑马灯 pod 'MarqueeLabel' +#广告组 + end diff --git a/Podfile.lock b/Podfile.lock index f8814e6..2fbc0df 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -57,6 +57,6 @@ SPEC CHECKSUMS: SwiftDate: 72d28954e8e1c6c1c0f917ccc8005e4f83c7d4b2 Tiercel: c0a73f876a72800333b15f4e7e48791f4ad21e90 -PODFILE CHECKSUM: 0dbe586b5221e955924da76b16705e9638055ea1 +PODFILE CHECKSUM: a6a950e98b8cead689397a03a4720306543eb266 COCOAPODS: 1.15.2 diff --git a/Pods/Manifest.lock b/Pods/Manifest.lock index f8814e6..2fbc0df 100644 --- a/Pods/Manifest.lock +++ b/Pods/Manifest.lock @@ -57,6 +57,6 @@ SPEC CHECKSUMS: SwiftDate: 72d28954e8e1c6c1c0f917ccc8005e4f83c7d4b2 Tiercel: c0a73f876a72800333b15f4e7e48791f4ad21e90 -PODFILE CHECKSUM: 0dbe586b5221e955924da76b16705e9638055ea1 +PODFILE CHECKSUM: a6a950e98b8cead689397a03a4720306543eb266 COCOAPODS: 1.15.2 diff --git a/Pods/Target Support Files/Pods-relax.offline.mp3.music/Pods-relax.offline.mp3.music-resources-Debug-input-files.xcfilelist b/Pods/Target Support Files/Pods-relax.offline.mp3.music/Pods-relax.offline.mp3.music-resources-Debug-input-files.xcfilelist deleted file mode 100644 index ecc94c7..0000000 --- a/Pods/Target Support Files/Pods-relax.offline.mp3.music/Pods-relax.offline.mp3.music-resources-Debug-input-files.xcfilelist +++ /dev/null @@ -1,3 +0,0 @@ -${PODS_ROOT}/Target Support Files/Pods-relax.offline.mp3.music/Pods-relax.offline.mp3.music-resources.sh -${PODS_CONFIGURATION_BUILD_DIR}/Google-Mobile-Ads-SDK/GoogleMobileAdsResources.bundle -${PODS_CONFIGURATION_BUILD_DIR}/GoogleUserMessagingPlatform/UserMessagingPlatformResources.bundle \ No newline at end of file diff --git a/Pods/Target Support Files/Pods-relax.offline.mp3.music/Pods-relax.offline.mp3.music-resources-Debug-output-files.xcfilelist b/Pods/Target Support Files/Pods-relax.offline.mp3.music/Pods-relax.offline.mp3.music-resources-Debug-output-files.xcfilelist deleted file mode 100644 index 3a0a66c..0000000 --- a/Pods/Target Support Files/Pods-relax.offline.mp3.music/Pods-relax.offline.mp3.music-resources-Debug-output-files.xcfilelist +++ /dev/null @@ -1,2 +0,0 @@ -${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/GoogleMobileAdsResources.bundle -${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/UserMessagingPlatformResources.bundle \ No newline at end of file diff --git a/Pods/Target Support Files/Pods-relax.offline.mp3.music/Pods-relax.offline.mp3.music-resources-Release-input-files.xcfilelist b/Pods/Target Support Files/Pods-relax.offline.mp3.music/Pods-relax.offline.mp3.music-resources-Release-input-files.xcfilelist deleted file mode 100644 index ecc94c7..0000000 --- a/Pods/Target Support Files/Pods-relax.offline.mp3.music/Pods-relax.offline.mp3.music-resources-Release-input-files.xcfilelist +++ /dev/null @@ -1,3 +0,0 @@ -${PODS_ROOT}/Target Support Files/Pods-relax.offline.mp3.music/Pods-relax.offline.mp3.music-resources.sh -${PODS_CONFIGURATION_BUILD_DIR}/Google-Mobile-Ads-SDK/GoogleMobileAdsResources.bundle -${PODS_CONFIGURATION_BUILD_DIR}/GoogleUserMessagingPlatform/UserMessagingPlatformResources.bundle \ No newline at end of file diff --git a/Pods/Target Support Files/Pods-relax.offline.mp3.music/Pods-relax.offline.mp3.music-resources-Release-output-files.xcfilelist b/Pods/Target Support Files/Pods-relax.offline.mp3.music/Pods-relax.offline.mp3.music-resources-Release-output-files.xcfilelist deleted file mode 100644 index 3a0a66c..0000000 --- a/Pods/Target Support Files/Pods-relax.offline.mp3.music/Pods-relax.offline.mp3.music-resources-Release-output-files.xcfilelist +++ /dev/null @@ -1,2 +0,0 @@ -${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/GoogleMobileAdsResources.bundle -${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/UserMessagingPlatformResources.bundle \ No newline at end of file diff --git a/Pods/Target Support Files/Pods-relax.offline.mp3.music/Pods-relax.offline.mp3.music-resources.sh b/Pods/Target Support Files/Pods-relax.offline.mp3.music/Pods-relax.offline.mp3.music-resources.sh deleted file mode 100755 index bc6121d..0000000 --- a/Pods/Target Support Files/Pods-relax.offline.mp3.music/Pods-relax.offline.mp3.music-resources.sh +++ /dev/null @@ -1,131 +0,0 @@ -#!/bin/sh -set -e -set -u -set -o pipefail - -function on_error { - echo "$(realpath -mq "${0}"):$1: error: Unexpected failure" -} -trap 'on_error $LINENO' ERR - -if [ -z ${UNLOCALIZED_RESOURCES_FOLDER_PATH+x} ]; then - # If UNLOCALIZED_RESOURCES_FOLDER_PATH is not set, then there's nowhere for us to copy - # resources to, so exit 0 (signalling the script phase was successful). - exit 0 -fi - -mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" - -RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt -> "$RESOURCES_TO_COPY" - -XCASSET_FILES=() - -# This protects against multiple targets copying the same framework dependency at the same time. The solution -# was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html -RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") - -case "${TARGETED_DEVICE_FAMILY:-}" in - 1,2) - TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" - ;; - 1) - TARGET_DEVICE_ARGS="--target-device iphone" - ;; - 2) - TARGET_DEVICE_ARGS="--target-device ipad" - ;; - 3) - TARGET_DEVICE_ARGS="--target-device tv" - ;; - 4) - TARGET_DEVICE_ARGS="--target-device watch" - ;; - *) - TARGET_DEVICE_ARGS="--target-device mac" - ;; -esac - -install_resource() -{ - if [[ "$1" = /* ]] ; then - RESOURCE_PATH="$1" - else - RESOURCE_PATH="${PODS_ROOT}/$1" - fi - if [[ ! -e "$RESOURCE_PATH" ]] ; then - cat << EOM -error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script. -EOM - exit 1 - fi - case $RESOURCE_PATH in - *.storyboard) - echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true - ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} - ;; - *.xib) - echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true - ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} - ;; - *.framework) - echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true - mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" - echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true - rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" - ;; - *.xcdatamodel) - echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" || true - xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom" - ;; - *.xcdatamodeld) - echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" || true - xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd" - ;; - *.xcmappingmodel) - echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" || true - xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm" - ;; - *.xcassets) - ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH" - XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") - ;; - *) - echo "$RESOURCE_PATH" || true - echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY" - ;; - esac -} -if [[ "$CONFIGURATION" == "Debug" ]]; then - install_resource "${PODS_CONFIGURATION_BUILD_DIR}/Google-Mobile-Ads-SDK/GoogleMobileAdsResources.bundle" - install_resource "${PODS_CONFIGURATION_BUILD_DIR}/GoogleUserMessagingPlatform/UserMessagingPlatformResources.bundle" -fi -if [[ "$CONFIGURATION" == "Release" ]]; then - install_resource "${PODS_CONFIGURATION_BUILD_DIR}/Google-Mobile-Ads-SDK/GoogleMobileAdsResources.bundle" - install_resource "${PODS_CONFIGURATION_BUILD_DIR}/GoogleUserMessagingPlatform/UserMessagingPlatformResources.bundle" -fi - -mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" -rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" -if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then - mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" - rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" -fi -rm -f "$RESOURCES_TO_COPY" - -if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "${XCASSET_FILES:-}" ] -then - # Find all other xcassets (this unfortunately includes those of path pods and other targets). - OTHER_XCASSETS=$(find -L "$PWD" -iname "*.xcassets" -type d) - while read line; do - if [[ $line != "${PODS_ROOT}*" ]]; then - XCASSET_FILES+=("$line") - fi - done <<<"$OTHER_XCASSETS" - - if [ -z ${ASSETCATALOG_COMPILER_APPICON_NAME+x} ]; then - printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" - else - printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" --app-icon "${ASSETCATALOG_COMPILER_APPICON_NAME}" --output-partial-info-plist "${TARGET_TEMP_DIR}/assetcatalog_generated_info_cocoapods.plist" - fi -fi diff --git a/relax.offline.mp3.music.xcodeproj/project.pbxproj b/relax.offline.mp3.music.xcodeproj/project.pbxproj index 640a340..9f05c84 100644 --- a/relax.offline.mp3.music.xcodeproj/project.pbxproj +++ b/relax.offline.mp3.music.xcodeproj/project.pbxproj @@ -7,8 +7,7 @@ objects = { /* Begin PBXBuildFile section */ - 46C4D5B84AF3CA6292152C70 /* Pods_relax_offline_mp3_music.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8DB1E9160CFEC3A0E35F11BF /* Pods_relax_offline_mp3_music.framework */; }; - CB000F442C12AD2300B0FC0A /* GoogleMobileAds in Frameworks */ = {isa = PBXBuildFile; productRef = CB000F432C12AD2300B0FC0A /* GoogleMobileAds */; }; + 82F33EC0D64393B7AAD72A45 /* Pods_relax_offline_mp3_music.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 10D55D4705A4D9E0F0805527 /* Pods_relax_offline_mp3_music.framework */; }; CB0033F02C290AC200B18FD3 /* MPPositive_CustomPlayListViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = CB0033EF2C290AC200B18FD3 /* MPPositive_CustomPlayListViewModel.swift */; }; CB0033F22C291C7700B18FD3 /* MPPositive_CollectionListsShowTypeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = CB0033F12C291C7700B18FD3 /* MPPositive_CollectionListsShowTypeView.swift */; }; CB0033F42C294DBF00B18FD3 /* MPPositive_CustomPlayListViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CB0033F32C294DBF00B18FD3 /* MPPositive_CustomPlayListViewController.swift */; }; @@ -26,7 +25,6 @@ CB2CAAD42C59DC1100EF691D /* MPPositive_TrashListModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = CB2CAAD32C59DC1100EF691D /* MPPositive_TrashListModel.swift */; }; CB2CAAD72C5A1AC500EF691D /* MP_IAPViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = CB2CAAD62C5A1AC500EF691D /* MP_IAPViewController.xib */; }; CB2CAAD82C5A1AC500EF691D /* MP_IAPViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CB2CAAD52C5A1AC500EF691D /* MP_IAPViewController.swift */; }; - CB4FA4D92C5CDC4A0027C949 /* relax.offline.mp3.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = CB4FA4D72C5CDC4A0027C949 /* relax.offline.mp3.xcdatamodeld */; }; CB6EEB8E2C5DFE6100AEC414 /* StoreKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CB6EEB8D2C5DFE6100AEC414 /* StoreKit.framework */; }; CB7FC5422C2AA01F00292A43 /* FacebookAEM in Frameworks */ = {isa = PBXBuildFile; productRef = CB7FC5412C2AA01F00292A43 /* FacebookAEM */; }; CB7FC5442C2AA01F00292A43 /* FacebookBasics in Frameworks */ = {isa = PBXBuildFile; productRef = CB7FC5432C2AA01F00292A43 /* FacebookBasics */; }; @@ -255,12 +253,15 @@ CBDBDDF22C40C40900767F0B /* MPPositive_GridLoadViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = CBDBDDF12C40C40900767F0B /* MPPositive_GridLoadViewModel.swift */; }; CBDBDDF42C40D03F00767F0B /* MPPositive_SearchGrideCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = CBDBDDF32C40D03F00767F0B /* MPPositive_SearchGrideCollectionViewCell.swift */; }; CBDBDDF62C40FFC600767F0B /* MPPositive_GrideMoodViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CBDBDDF52C40FFC600767F0B /* MPPositive_GrideMoodViewController.swift */; }; + CBDC4A292C61B88300960649 /* relax.offline.mp3.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = CBDC4A272C61B88300960649 /* relax.offline.mp3.xcdatamodeld */; }; + CBDC4A402C6219EF00960649 /* GoogleMobileAds in Frameworks */ = {isa = PBXBuildFile; productRef = CBDC4A3F2C6219EF00960649 /* GoogleMobileAds */; }; CBF3AEDA2C255B1200947AFC /* MPPositive_PlayListsShowTypeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = CBF3AED92C255B1200947AFC /* MPPositive_PlayListsShowTypeView.swift */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ - 5D0F6D7469D3B1668D7B52D9 /* Pods-relax.offline.mp3.music.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-relax.offline.mp3.music.release.xcconfig"; path = "Target Support Files/Pods-relax.offline.mp3.music/Pods-relax.offline.mp3.music.release.xcconfig"; sourceTree = ""; }; - 8DB1E9160CFEC3A0E35F11BF /* Pods_relax_offline_mp3_music.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_relax_offline_mp3_music.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 10D55D4705A4D9E0F0805527 /* Pods_relax_offline_mp3_music.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_relax_offline_mp3_music.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 4CEDA702C32CE777A8364913 /* Pods-relax.offline.mp3.music.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-relax.offline.mp3.music.debug.xcconfig"; path = "Target Support Files/Pods-relax.offline.mp3.music/Pods-relax.offline.mp3.music.debug.xcconfig"; sourceTree = ""; }; + 52181392A4B967D8F80363A1 /* Pods-relax.offline.mp3.music.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-relax.offline.mp3.music.release.xcconfig"; path = "Target Support Files/Pods-relax.offline.mp3.music/Pods-relax.offline.mp3.music.release.xcconfig"; sourceTree = ""; }; CB0033EF2C290AC200B18FD3 /* MPPositive_CustomPlayListViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MPPositive_CustomPlayListViewModel.swift; sourceTree = ""; }; CB0033F12C291C7700B18FD3 /* MPPositive_CollectionListsShowTypeView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MPPositive_CollectionListsShowTypeView.swift; sourceTree = ""; }; CB0033F32C294DBF00B18FD3 /* MPPositive_CustomPlayListViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MPPositive_CustomPlayListViewController.swift; sourceTree = ""; }; @@ -281,7 +282,6 @@ CB2CAAD32C59DC1100EF691D /* MPPositive_TrashListModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MPPositive_TrashListModel.swift; sourceTree = ""; }; CB2CAAD52C5A1AC500EF691D /* MP_IAPViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MP_IAPViewController.swift; sourceTree = ""; }; CB2CAAD62C5A1AC500EF691D /* MP_IAPViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MP_IAPViewController.xib; sourceTree = ""; }; - CB4FA4D82C5CDC4A0027C949 /* MusicPlayer.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = MusicPlayer.xcdatamodel; sourceTree = ""; }; CB6EEB8D2C5DFE6100AEC414 /* StoreKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = StoreKit.framework; path = System/Library/Frameworks/StoreKit.framework; sourceTree = SDKROOT; }; CB7FC5472C2AC25C00292A43 /* MPPositive_CenterListSearchView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MPPositive_CenterListSearchView.swift; sourceTree = ""; }; CBAFC9F22C0A10500054500E /* MP_BaseViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MP_BaseViewController.swift; sourceTree = ""; }; @@ -506,8 +506,8 @@ CBDBDDF12C40C40900767F0B /* MPPositive_GridLoadViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MPPositive_GridLoadViewModel.swift; sourceTree = ""; }; CBDBDDF32C40D03F00767F0B /* MPPositive_SearchGrideCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MPPositive_SearchGrideCollectionViewCell.swift; sourceTree = ""; }; CBDBDDF52C40FFC600767F0B /* MPPositive_GrideMoodViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MPPositive_GrideMoodViewController.swift; sourceTree = ""; }; + CBDC4A282C61B88300960649 /* MusicPlayer.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = MusicPlayer.xcdatamodel; sourceTree = ""; }; CBF3AED92C255B1200947AFC /* MPPositive_PlayListsShowTypeView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MPPositive_PlayListsShowTypeView.swift; sourceTree = ""; }; - EE70E1FE424F9A64CCD389DD /* Pods-relax.offline.mp3.music.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-relax.offline.mp3.music.debug.xcconfig"; path = "Target Support Files/Pods-relax.offline.mp3.music/Pods-relax.offline.mp3.music.debug.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -517,14 +517,14 @@ files = ( CB7FC5442C2AA01F00292A43 /* FacebookBasics in Frameworks */, CB7FC5422C2AA01F00292A43 /* FacebookAEM in Frameworks */, + CBDC4A402C6219EF00960649 /* GoogleMobileAds in Frameworks */, CBAFCBAD2C0A10DA0054500E /* FirebaseCrashlytics in Frameworks */, CBD4570D2C2EC38400CE766D /* AppTrackingTransparency.framework in Frameworks */, CBAFCBAB2C0A10DA0054500E /* FirebaseAnalytics in Frameworks */, - CB000F442C12AD2300B0FC0A /* GoogleMobileAds in Frameworks */, - 46C4D5B84AF3CA6292152C70 /* Pods_relax_offline_mp3_music.framework in Frameworks */, CB6EEB8E2C5DFE6100AEC414 /* StoreKit.framework in Frameworks */, CBAFCBAF2C0A10DA0054500E /* FirebaseRemoteConfig in Frameworks */, CB7FC5462C2AA01F00292A43 /* FacebookCore in Frameworks */, + 82F33EC0D64393B7AAD72A45 /* Pods_relax_offline_mp3_music.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -536,7 +536,7 @@ children = ( CB6EEB8D2C5DFE6100AEC414 /* StoreKit.framework */, CBD4570C2C2EC38400CE766D /* AppTrackingTransparency.framework */, - 8DB1E9160CFEC3A0E35F11BF /* Pods_relax_offline_mp3_music.framework */, + 10D55D4705A4D9E0F0805527 /* Pods_relax_offline_mp3_music.framework */, ); name = Frameworks; sourceTree = ""; @@ -544,8 +544,8 @@ 96A499915F2622FAB880DA5B /* Pods */ = { isa = PBXGroup; children = ( - EE70E1FE424F9A64CCD389DD /* Pods-relax.offline.mp3.music.debug.xcconfig */, - 5D0F6D7469D3B1668D7B52D9 /* Pods-relax.offline.mp3.music.release.xcconfig */, + 4CEDA702C32CE777A8364913 /* Pods-relax.offline.mp3.music.debug.xcconfig */, + 52181392A4B967D8F80363A1 /* Pods-relax.offline.mp3.music.release.xcconfig */, ); path = Pods; sourceTree = ""; @@ -598,7 +598,7 @@ CBAFC9FB2C0A10500054500E /* DataBase */ = { isa = PBXGroup; children = ( - CB4FA4D72C5CDC4A0027C949 /* relax.offline.mp3.xcdatamodeld */, + CBDC4A272C61B88300960649 /* relax.offline.mp3.xcdatamodeld */, ); path = DataBase; sourceTree = ""; @@ -1217,12 +1217,12 @@ isa = PBXNativeTarget; buildConfigurationList = CBC2D6FF2BFDF3D800E17703 /* Build configuration list for PBXNativeTarget "relax.offline.mp3.music" */; buildPhases = ( - CFEB2643ED606EF96359B55A /* [CP] Check Pods Manifest.lock */, + 0445BFB07A72203603FD6CBA /* [CP] Check Pods Manifest.lock */, CBC2D6E42BFDF3D700E17703 /* Sources */, CBC2D6E52BFDF3D700E17703 /* Frameworks */, CBC2D6E62BFDF3D700E17703 /* Resources */, - B1C37032482F13ACE7C8DA99 /* [CP] Embed Pods Frameworks */, 0018BD0A2C1050F60066717C /* ShellScript */, + 4F340A16CA4CBC1A386EF0AF /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -1233,10 +1233,10 @@ CBAFCBAA2C0A10DA0054500E /* FirebaseAnalytics */, CBAFCBAC2C0A10DA0054500E /* FirebaseCrashlytics */, CBAFCBAE2C0A10DA0054500E /* FirebaseRemoteConfig */, - CB000F432C12AD2300B0FC0A /* GoogleMobileAds */, CB7FC5412C2AA01F00292A43 /* FacebookAEM */, CB7FC5432C2AA01F00292A43 /* FacebookBasics */, CB7FC5452C2AA01F00292A43 /* FacebookCore */, + CBDC4A3F2C6219EF00960649 /* GoogleMobileAds */, ); productName = relax.offline.mp3.music; productReference = CBC2D6E82BFDF3D700E17703 /* relax.offline.mp3.music.app */; @@ -1268,8 +1268,8 @@ mainGroup = CBC2D6DF2BFDF3D700E17703; packageReferences = ( CBAFCBA92C0A10DA0054500E /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */, - CB000F422C12AD2300B0FC0A /* XCRemoteSwiftPackageReference "swift-package-manager-google-mobile-ads" */, CB7FC5402C2AA01F00292A43 /* XCRemoteSwiftPackageReference "facebook-ios-sdk" */, + CBDC4A3E2C6219EF00960649 /* XCRemoteSwiftPackageReference "swift-package-manager-google-mobile-ads" */, ); productRefGroup = CBC2D6E92BFDF3D700E17703 /* Products */; projectDirPath = ""; @@ -1356,24 +1356,7 @@ shellPath = /bin/sh; shellScript = "\"${BUILD_DIR%/Build/*}/SourcePackages/checkouts/firebase-ios-sdk/Crashlytics/run\"\n"; }; - B1C37032482F13ACE7C8DA99 /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-relax.offline.mp3.music/Pods-relax.offline.mp3.music-frameworks-${CONFIGURATION}-input-files.xcfilelist", - ); - name = "[CP] Embed Pods Frameworks"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-relax.offline.mp3.music/Pods-relax.offline.mp3.music-frameworks-${CONFIGURATION}-output-files.xcfilelist", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-relax.offline.mp3.music/Pods-relax.offline.mp3.music-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; - CFEB2643ED606EF96359B55A /* [CP] Check Pods Manifest.lock */ = { + 0445BFB07A72203603FD6CBA /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -1395,6 +1378,23 @@ shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; + 4F340A16CA4CBC1A386EF0AF /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-relax.offline.mp3.music/Pods-relax.offline.mp3.music-frameworks-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Embed Pods Frameworks"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-relax.offline.mp3.music/Pods-relax.offline.mp3.music-frameworks-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-relax.offline.mp3.music/Pods-relax.offline.mp3.music-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -1411,6 +1411,7 @@ CBD344DE2C3FD8230095F18F /* MPPositive_GridViewModel.swift in Sources */, CBAFCB622C0A10500054500E /* MPPositive_HomeListFirstCollectionViewCell.swift in Sources */, CBAFCB112C0A10500054500E /* MP_PlayerManager.swift in Sources */, + CBDC4A292C61B88300960649 /* relax.offline.mp3.xcdatamodeld in Sources */, CBAFCB582C0A10500054500E /* MPPositive_LibraryTableViewCell.swift in Sources */, CBAFCB222C0A10500054500E /* MPPositive_JsonSearchTypeResults.swift in Sources */, CBAFCB492C0A10500054500E /* MPPositive_OfflineSongsViewController.swift in Sources */, @@ -1439,7 +1440,6 @@ CBAFCAF52C0A10500054500E /* CoreDataDelegete.swift in Sources */, CBAFCB5B2C0A10500054500E /* MPPositive_ArtistShowCollectionViewCell.swift in Sources */, CBAFCB182C0A10500054500E /* MPPositive_JsonArtistMore.swift in Sources */, - CB4FA4D92C5CDC4A0027C949 /* relax.offline.mp3.xcdatamodeld in Sources */, CBAFCB982C0A10500054500E /* MPSideA_CustomTabBarItem.swift in Sources */, CBAFCB5D2C0A10500054500E /* MPPositive_ArtistShowListableViewCell.swift in Sources */, CBAFCB7D2C0A10500054500E /* MPSideA_PresentationController.swift in Sources */, @@ -1741,7 +1741,7 @@ }; CBC2D7002BFDF3D800E17703 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = EE70E1FE424F9A64CCD389DD /* Pods-relax.offline.mp3.music.debug.xcconfig */; + baseConfigurationReference = 4CEDA702C32CE777A8364913 /* Pods-relax.offline.mp3.music.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; @@ -1787,7 +1787,7 @@ }; CBC2D7012BFDF3D800E17703 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 5D0F6D7469D3B1668D7B52D9 /* Pods-relax.offline.mp3.music.release.xcconfig */; + baseConfigurationReference = 52181392A4B967D8F80363A1 /* Pods-relax.offline.mp3.music.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; @@ -1855,14 +1855,6 @@ /* End XCConfigurationList section */ /* Begin XCRemoteSwiftPackageReference section */ - CB000F422C12AD2300B0FC0A /* XCRemoteSwiftPackageReference "swift-package-manager-google-mobile-ads" */ = { - isa = XCRemoteSwiftPackageReference; - repositoryURL = "https://github.com/googleads/swift-package-manager-google-mobile-ads.git"; - requirement = { - kind = upToNextMajorVersion; - minimumVersion = 11.5.0; - }; - }; CB7FC5402C2AA01F00292A43 /* XCRemoteSwiftPackageReference "facebook-ios-sdk" */ = { isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/facebook/facebook-ios-sdk"; @@ -1879,14 +1871,17 @@ minimumVersion = 10.27.0; }; }; + CBDC4A3E2C6219EF00960649 /* XCRemoteSwiftPackageReference "swift-package-manager-google-mobile-ads" */ = { + isa = XCRemoteSwiftPackageReference; + repositoryURL = "https://github.com/googleads/swift-package-manager-google-mobile-ads.git"; + requirement = { + kind = upToNextMajorVersion; + minimumVersion = 11.7.0; + }; + }; /* End XCRemoteSwiftPackageReference section */ /* Begin XCSwiftPackageProductDependency section */ - CB000F432C12AD2300B0FC0A /* GoogleMobileAds */ = { - isa = XCSwiftPackageProductDependency; - package = CB000F422C12AD2300B0FC0A /* XCRemoteSwiftPackageReference "swift-package-manager-google-mobile-ads" */; - productName = GoogleMobileAds; - }; CB7FC5412C2AA01F00292A43 /* FacebookAEM */ = { isa = XCSwiftPackageProductDependency; package = CB7FC5402C2AA01F00292A43 /* XCRemoteSwiftPackageReference "facebook-ios-sdk" */; @@ -1917,17 +1912,22 @@ package = CBAFCBA92C0A10DA0054500E /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */; productName = FirebaseRemoteConfig; }; + CBDC4A3F2C6219EF00960649 /* GoogleMobileAds */ = { + isa = XCSwiftPackageProductDependency; + package = CBDC4A3E2C6219EF00960649 /* XCRemoteSwiftPackageReference "swift-package-manager-google-mobile-ads" */; + productName = GoogleMobileAds; + }; /* End XCSwiftPackageProductDependency section */ /* Begin XCVersionGroup section */ - CB4FA4D72C5CDC4A0027C949 /* relax.offline.mp3.xcdatamodeld */ = { + CBDC4A272C61B88300960649 /* relax.offline.mp3.xcdatamodeld */ = { isa = XCVersionGroup; children = ( - CB4FA4D82C5CDC4A0027C949 /* MusicPlayer.xcdatamodel */, + CBDC4A282C61B88300960649 /* MusicPlayer.xcdatamodel */, ); - currentVersion = CB4FA4D82C5CDC4A0027C949 /* MusicPlayer.xcdatamodel */; + currentVersion = CBDC4A282C61B88300960649 /* MusicPlayer.xcdatamodel */; name = relax.offline.mp3.xcdatamodeld; - path = "/Users/zhou/Desktop/纳克斯互娱/relax.offline.mp3.music/relax.offline.mp3.music/MP/Common/DataBase/relax.offline.mp3.xcdatamodeld"; + path = "/Users/zhou/Desktop/纳克斯互娱/MusicLax/relax.offline.mp3.music/MP/Common/DataBase/relax.offline.mp3.xcdatamodeld"; sourceTree = ""; versionGroupType = wrapper.xcdatamodel; }; diff --git a/relax.offline.mp3.music.xcworkspace/xcshareddata/swiftpm/Package.resolved b/relax.offline.mp3.music.xcworkspace/xcshareddata/swiftpm/Package.resolved index 10a552e..9c15645 100644 --- a/relax.offline.mp3.music.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/relax.offline.mp3.music.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -123,8 +123,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/googleads/swift-package-manager-google-mobile-ads.git", "state" : { - "revision" : "2e4ae78561feac7192c5d8757464546adebb4c7d", - "version" : "11.6.0" + "revision" : "6457f9651bea0d62a548ac63fa9d34aae7d0488e", + "version" : "11.7.0" } }, { diff --git a/relax.offline.mp3.music.xcworkspace/xcuserdata/zhou.xcuserdatad/UserInterfaceState.xcuserstate b/relax.offline.mp3.music.xcworkspace/xcuserdata/zhou.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..46690c1 Binary files /dev/null and b/relax.offline.mp3.music.xcworkspace/xcuserdata/zhou.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/relax.offline.mp3.music/MP/Common/Tool(工具封装)/MP_NetWorkManager.swift b/relax.offline.mp3.music/MP/Common/Tool(工具封装)/MP_NetWorkManager.swift index 6c0e152..96518e1 100644 --- a/relax.offline.mp3.music/MP/Common/Tool(工具封装)/MP_NetWorkManager.swift +++ b/relax.offline.mp3.music/MP/Common/Tool(工具封装)/MP_NetWorkManager.swift @@ -527,6 +527,59 @@ extension MP_NetWorkManager { } } } + ///请求歌单排行榜(美国限定) + private func requestChartsUS() { + //拼接出browse路径 + let path = header+point+browse + //设置url + guard let url = URL(string: path) else { + print("Url is Incorrect") + return + } + //异步执行任务 + browseQueque?.sync { + [weak self] in + guard let self = self else { return } + let parameters:[String:Any] = [ + "browseId": "FEmusic_charts", + "prettyPrint":"false", + "context":[ + "client":[ + //web端 + "clientName": "WEB_REMIX", + //当前访问版本(日期值) + "clientVersion": clientVersion, + "platform":"MOBILE", + //语言 + "hl":Language_first_local, + //地址 + "gl":locaton ?? "" + ] + ], + "formData":[ + "selectedValues":["US"] + ] + ] + requestPostChartsUS(url, parameters: parameters) + } + } + ///请求最后的排行数据 + private func requestPostChartsUS(_ url:URL, parameters:Parameters) { + MPSession.request(url, method: .post, parameters: parameters, encoding: JSONEncoding.default).responseDecodable(of: JsonCharts.self) { [weak self] (response) in + guard let self = self else {return} + switch response.result { + case .success(let charts): + if let content = charts.contents?.singleColumnBrowseResultsRenderer?.tabs?.first?.tabRenderer?.content?.sectionListRenderer?.contents { + parsingChartsUS(content) + } + case .failure(let error): + print("Failed to parse browses content") + // 请求失败,处理错误 + homeError(error: error) + browseQueque = nil + } + } + } //MARK: - 请求列表专辑预览 /// 向YouTubemusic请求列表/专辑数据,该接口调用的同样是browse预览接口 /// - Parameters: @@ -1625,10 +1678,37 @@ extension MP_NetWorkManager { return } //传递解析数据 + self.browseRequestStateBlock!(browses, false) + requestChartsUS() + } + private func parsingChartsUS(_ contents:[JsonCharts.Contents.SingleColumnBrowseResultsRenderer.Tab.TabRenderer.Content.SectionListRenderer.Content]) { + var browses:[MPPositive_BrowseModuleListViewModel] = [] + contents.forEach { content in + //检索content是否存在二阶段数据 + if let musicCarouselShelfRenderer = content.musicCarouselShelfRenderer { + //存在,继续操作 + let browse = MPPositive_BrowseModuleListViewModel() + browse.title = musicCarouselShelfRenderer.header?.musicCarouselShelfBasicHeaderRenderer?.title?.runs?.first?.text + //获取数据 + musicCarouselShelfRenderer.contents?.forEach({ content in + if let musicTwoRowItemRenderer = content.musicTwoRowItemRenderer, let item = parsingMusicTwoRowItemRenderer(musicTwoRowItemRenderer) { + browse.items.append(.init(item)) + } + }) + browses.append(browse) + } + } + //清理为空的数据 + browses = browses.filter({$0.items.contains(where: {$0.browseItem.pageType == "MUSIC_PAGE_TYPE_PLAYLIST"})}) + guard browseRequestStateBlock != nil else { + return + } + //传递解析数据 self.browseRequestStateBlock!(browses, true) //移除队列 browseQueque = nil } + ///解析预览内容_ContinuationContents private func parsingBrowseContinuationContents(_ continuationContents:JsonBrowses.ContinuationContents) { //获取预览结构体中需要的数据(模块标题;歌曲信息:封面路径,音乐标题,歌手姓名,列表id和视频id) diff --git a/relax.offline.mp3.music/MP/MPPositive/Models/JsonStructs(js文件结构)/MPPositive_JsonCharts.swift b/relax.offline.mp3.music/MP/MPPositive/Models/JsonStructs(js文件结构)/MPPositive_JsonCharts.swift index a41d4d7..343ea60 100644 --- a/relax.offline.mp3.music/MP/MPPositive/Models/JsonStructs(js文件结构)/MPPositive_JsonCharts.swift +++ b/relax.offline.mp3.music/MP/MPPositive/Models/JsonStructs(js文件结构)/MPPositive_JsonCharts.swift @@ -149,14 +149,15 @@ struct JsonCharts: Codable { ///内容模块 struct Content: Codable { let musicResponsiveListItemRenderer:MusicResponsiveListItemRenderer? + let musicTwoRowItemRenderer:RootMusicTwoRowItemRenderer? enum CodingKeys: String, CodingKey { case musicResponsiveListItemRenderer = "musicResponsiveListItemRenderer" - + case musicTwoRowItemRenderer = "musicTwoRowItemRenderer" } init(from decoder: Decoder) throws { let values = try decoder.container(keyedBy: CodingKeys.self) musicResponsiveListItemRenderer = try values.decodeIfPresent(MusicResponsiveListItemRenderer.self, forKey: .musicResponsiveListItemRenderer) - + musicTwoRowItemRenderer = try values.decodeIfPresent(RootMusicTwoRowItemRenderer.self, forKey: .musicTwoRowItemRenderer) } struct MusicResponsiveListItemRenderer: Codable { ///封面 diff --git a/relax.offline.mp3.music/MP/MPPositive/ViewControllers/Home(首页,各项列表页,艺术家页)/MPPositive_HomeViewController.swift b/relax.offline.mp3.music/MP/MPPositive/ViewControllers/Home(首页,各项列表页,艺术家页)/MPPositive_HomeViewController.swift index 638c083..418b29c 100644 --- a/relax.offline.mp3.music/MP/MPPositive/ViewControllers/Home(首页,各项列表页,艺术家页)/MPPositive_HomeViewController.swift +++ b/relax.offline.mp3.music/MP/MPPositive/ViewControllers/Home(首页,各项列表页,艺术家页)/MPPositive_HomeViewController.swift @@ -451,6 +451,7 @@ extension MPPositive_HomeViewController: UITableViewDataSource, UITableViewDeleg self.navView.frame = frame } } + func numberOfSections(in tableView: UITableView) -> Int { if MPPositive_BrowseLoadViewModel.shared.libraryList.libraryViewModels.isEmpty { return 1 @@ -471,12 +472,16 @@ extension MPPositive_HomeViewController: UITableViewDataSource, UITableViewDeleg } } func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { - if MPPositive_BrowseLoadViewModel.shared.libraryList.libraryViewModels.isEmpty { - if let first = MPPositive_BrowseLoadViewModel.shared.browseModuleLists[indexPath.row].items.first, first.browseItem.itemType == .single, first.browseItem.pageType == "MUSIC_VIDEO_TYPE_ATV" { + switch indexPath.section { + case 0: + let cell = tableView.dequeueReusableCell(withIdentifier: MPPositive_HomeLibraryListstableViewCellID, for: indexPath) as! MPPositive_HomeLibraryListstableViewCell + cell.libraryViewModels = MPPositive_BrowseLoadViewModel.shared.libraryList.libraryViewModels + return cell + default: + if let first = MPPositive_BrowseLoadViewModel.shared.browseModuleLists[indexPath.row].items.first, first.browseItem.itemType == .single, (first.browseItem.pageType == "MUSIC_VIDEO_TYPE_ATV" || first.browseItem.pageType == "MUSIC_VIDEO_TYPE_UGC") { //是单曲 let cell = tableView.dequeueReusableCell(withIdentifier: MPPositive_HomeSinglesTableViewCellID, for: indexPath) as! MPPositive_HomeSinglesTableViewCell cell.browseViewModel = MPPositive_BrowseLoadViewModel.shared.browseModuleLists[indexPath.row] - return cell }else { let cell = tableView.dequeueReusableCell(withIdentifier: MPPositive_HomeShowTableViewCellID, for: indexPath) as! MPPositive_HomeShowTableViewCell @@ -546,88 +551,6 @@ extension MPPositive_HomeViewController: UITableViewDataSource, UITableViewDeleg } return cell } - }else { - switch indexPath.section { - case 0: - let cell = tableView.dequeueReusableCell(withIdentifier: MPPositive_HomeLibraryListstableViewCellID, for: indexPath) as! MPPositive_HomeLibraryListstableViewCell - cell.libraryViewModels = MPPositive_BrowseLoadViewModel.shared.libraryList.libraryViewModels - return cell - default: - if let first = MPPositive_BrowseLoadViewModel.shared.browseModuleLists[indexPath.row].items.first, first.browseItem.itemType == .single, first.browseItem.pageType == "MUSIC_VIDEO_TYPE_ATV" { - //是单曲 - let cell = tableView.dequeueReusableCell(withIdentifier: MPPositive_HomeSinglesTableViewCellID, for: indexPath) as! MPPositive_HomeSinglesTableViewCell - cell.browseViewModel = MPPositive_BrowseLoadViewModel.shared.browseModuleLists[indexPath.row] - - return cell - }else { - let cell = tableView.dequeueReusableCell(withIdentifier: MPPositive_HomeShowTableViewCellID, for: indexPath) as! MPPositive_HomeShowTableViewCell - cell.browseViewModel = MPPositive_BrowseLoadViewModel.shared.browseModuleLists[indexPath.row] - if let first = MPPositive_BrowseLoadViewModel.shared.browseModuleLists[indexPath.row].items.first, first.browseItem.itemType == .single, first.browseItem.pageType == "MUSIC_VIDEO_TYPE_OMV" { - cell.showType = .Fifth - }else { - //判断是列表还是艺术家 - if MPPositive_BrowseLoadViewModel.shared.browseModuleLists[indexPath.row].items.first?.browseItem.pageType == "MUSIC_PAGE_TYPE_ARTIST" { - cell.showType = .Fourth - }else { - cell.showType = .Third - } - } - cell.requestNextBlock = { - [weak self] (item) in - guard let self = self else {return} - MP_AnalyticsManager.shared.home_b_module_clickAction(item.browseItem.pageType ?? "") - switch item.browseItem.itemType { - case .single: - //单曲/视频跳转 - MPPositive_Debouncer.shared.call { - [weak self] in - guard let self = self else {return} - guard MP_NetWorkManager.shared.netWorkStatu == .reachable else { - MP_HUD.text("Weak connection.", delay: 2.0, completion: nil) - return - } - MP_AnalyticsManager.shared.song_clickAction("Home") - //优先清除数据 - MP_PlayerManager.shared.loadPlayer = nil - //弹出播放器 - NotificationCenter.notificationKey.post(notificationName: .pup_player_vc) - MP_AnalyticsManager.shared.player_b_impAction() - //触发next请求,优先获取列表全部单曲基础数据(不完善) - MP_NetWorkManager.shared.requestNextList(item.browseItem.playListId ?? "", videoId: item.browseItem.videoId ?? "", clickTrackingParams: item.browseItem.clickTrackingParams){ [weak self] listSongs in - guard let self = self else {return} - //回掉的数据并不完善,生成一个playerloadViewModel - let lodaViewModel = MPPositive_PlayerLoadViewModel(listSongs, currentVideoId: item.browseItem.videoId ?? "") - lodaViewModel.improveData(item.browseItem.videoId ?? "") - //更改播放器播放类型 - MP_PlayerManager.shared.setPlayType(.normal) - MP_PlayerManager.shared.loadPlayer = lodaViewModel - MP_AnalyticsManager.shared.player_b_listAction() - } - } - case .list: - isFirstAppearance = false - //列表专辑 - let listVC = MPPositive_ListShowViewController(item.browseItem.browseId ?? "", params: "", title: item.title ?? "", subtitle: item.subtitle ?? "", clickTrackingParams: item.browseItem.clickTrackingParams ?? "") - navigationController?.pushViewController(listVC, animated: true) - case .artist: - isFirstAppearance = false - //前往艺术家页面 - let artistVC = MPPositive_ArtistShowViewController(item.browseItem.artistId ?? "", clickTrackingParams: item.browseItem.clickTrackingParams ?? "") - navigationController?.pushViewController(artistVC, animated: true) - default: - break - } - } - cell.findMoreBlock = { - [weak self] in - guard let self = self else {return} - isFirstAppearance = false - let moreVC = MPPositive_MoreContentViewController(MPPositive_BrowseLoadViewModel.shared.browseModuleLists[indexPath.row]) - navigationController?.pushViewController(moreVC, animated: true) - } - return cell - } - } } } }