-
-
Notifications
You must be signed in to change notification settings - Fork 221
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added checker for deleted playlists and albums
- Loading branch information
Showing
2 changed files
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
dart scripts/checker.dart > checker.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// ignore_for_file: avoid_print | ||
|
||
import 'package:musify/DB/albums.db.dart'; | ||
import 'package:musify/DB/playlists.db.dart'; | ||
import 'package:youtube_explode_dart/youtube_explode_dart.dart'; | ||
|
||
final _yt = YoutubeExplode(); | ||
List playlists = [...playlistsDB, ...albumsDB]; | ||
|
||
void main() async { | ||
print('PLAYLISTS AND ALBUMS CHECKING RESULT:'); | ||
print(' '); | ||
for (final playlist in playlists) { | ||
final plist = await _yt.playlists.get(playlist['ytid']); | ||
|
||
if (plist.videoCount == null) { | ||
if (playlist['isAlbum'] != null && playlist['isAlbum']) { | ||
print('> The album with the ID ${playlist['ytid']} does not exist.'); | ||
} else { | ||
print('> The playlist with the ID ${playlist['ytid']} does not exist.'); | ||
} | ||
} | ||
} | ||
print(' '); | ||
print('The checking process is done'); | ||
} |