mirror of
https://github.com/zoriya/Opus.git
synced 2026-06-01 13:45:08 +00:00
Solving some bugs.
This commit is contained in:
@@ -170,10 +170,7 @@ namespace MusicApp
|
||||
StartActivity(inten);
|
||||
}
|
||||
|
||||
ConnectivityManager connectivityManager = (ConnectivityManager)GetSystemService(ConnectivityService);
|
||||
NetworkInfo activeNetworkInfo = connectivityManager.ActiveNetworkInfo;
|
||||
if(activeNetworkInfo != null && activeNetworkInfo.IsConnected)
|
||||
CheckForUpdate(this, false);
|
||||
CheckForUpdate(this, false);
|
||||
}
|
||||
|
||||
async void PrepareApp()
|
||||
@@ -1309,6 +1306,11 @@ namespace MusicApp
|
||||
|
||||
public async static void CheckForUpdate(Activity activity, bool displayToast)
|
||||
{
|
||||
ConnectivityManager connectivityManager = (ConnectivityManager)Application.Context.GetSystemService(ConnectivityService);
|
||||
NetworkInfo activeNetworkInfo = connectivityManager.ActiveNetworkInfo;
|
||||
if (activeNetworkInfo == null || !activeNetworkInfo.IsConnected)
|
||||
return;
|
||||
|
||||
string VersionAsset;
|
||||
AssetManager assets = Application.Context.Assets;
|
||||
using (StreamReader sr = new StreamReader(assets.Open("Version.txt")))
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using Android.Content;
|
||||
using Android.Database;
|
||||
using Android.Net;
|
||||
using Android.OS;
|
||||
using Android.Provider;
|
||||
using Android.Support.V4.App;
|
||||
@@ -114,6 +115,11 @@ namespace MusicApp.Resources.Portable_Class
|
||||
ListView.SetItemAnimator(new DefaultItemAnimator());
|
||||
ListView.ScrollChange += MainActivity.instance.Scroll;
|
||||
|
||||
ConnectivityManager connectivityManager = (ConnectivityManager)MainActivity.instance.GetSystemService(Context.ConnectivityService);
|
||||
NetworkInfo activeNetworkInfo = connectivityManager.ActiveNetworkInfo;
|
||||
if (activeNetworkInfo == null || !activeNetworkInfo.IsConnected)
|
||||
return;
|
||||
|
||||
ISharedPreferences prefManager = PreferenceManager.GetDefaultSharedPreferences(Activity);
|
||||
List<string> topics = prefManager.GetStringSet("selectedTopics", new string[] { }).ToList();
|
||||
foreach (string topic in topics)
|
||||
@@ -207,7 +213,7 @@ namespace MusicApp.Resources.Portable_Class
|
||||
|
||||
foreach (var ytItem in response.Items)
|
||||
{
|
||||
if(ytItem.Snippet.Title != "Deleted video")
|
||||
if (ytItem.Snippet.Title != "[Deleted video]" && ytItem.Snippet.Title != "Private video" && ytItem.Snippet.Title != "Deleted video")
|
||||
{
|
||||
Song song = new Song(ytItem.Snippet.Title, ytItem.Snippet.ChannelTitle, ytItem.Snippet.Thumbnails.High.Url, ytItem.ContentDetails.VideoId, -1, -1, ytItem.ContentDetails.VideoId, true);
|
||||
contentValue.Add(song);
|
||||
|
||||
@@ -422,7 +422,7 @@ namespace MusicApp.Resources.Portable_Class
|
||||
|
||||
foreach (var item in ytPlaylist.Items)
|
||||
{
|
||||
if (item.Snippet.Title != "Deleted video")
|
||||
if (item.Snippet.Title != "[Deleted video]" && item.Snippet.Title != "Private video" && item.Snippet.Title != "Deleted video")
|
||||
{
|
||||
Song song = new Song(item.Snippet.Title, item.Snippet.ChannelTitle, item.Snippet.Thumbnails.Default__.Url, item.ContentDetails.VideoId, -1, -1, item.ContentDetails.VideoId, true, false);
|
||||
tracks.Add(song);
|
||||
|
||||
@@ -149,7 +149,6 @@ namespace MusicApp.Resources.Portable_Class
|
||||
SearchResource.ListRequest searchResult = youtubeService.Search.List("snippet");
|
||||
searchResult.Fields = "items(id/videoId,id/playlistId,id/channelId,id/kind,snippet/title,snippet/thumbnails/high/url,snippet/channelTitle)";
|
||||
searchResult.Q = search.Replace(" ", "+-");
|
||||
searchResult.Type = "video";
|
||||
searchResult.TopicId = "/m/04rlf";
|
||||
switch (querryType)
|
||||
{
|
||||
@@ -184,6 +183,7 @@ namespace MusicApp.Resources.Portable_Class
|
||||
{
|
||||
case "youtube#video":
|
||||
kind = YtKind.Video;
|
||||
Console.WriteLine("&VideoID = " + video.Id.VideoId);
|
||||
videoInfo.youtubeID = video.Id.VideoId;
|
||||
break;
|
||||
case "youtube#playlist":
|
||||
@@ -253,7 +253,7 @@ namespace MusicApp.Resources.Portable_Class
|
||||
switch (result[position].Kind)
|
||||
{
|
||||
case YtKind.Video:
|
||||
Play(item.GetPath(), item.GetName(), item.GetArtist(), item.GetAlbum());
|
||||
Play(item.youtubeID, item.GetName(), item.GetArtist(), item.GetAlbum());
|
||||
break;
|
||||
case YtKind.Playlist:
|
||||
ViewGroup rootView = Activity.FindViewById<ViewGroup>(Android.Resource.Id.Content);
|
||||
@@ -300,19 +300,19 @@ namespace MusicApp.Resources.Portable_Class
|
||||
switch (args.Which)
|
||||
{
|
||||
case 0:
|
||||
Play(item.GetPath(), item.GetName(), item.GetArtist(), item.GetAlbum());
|
||||
Play(item.youtubeID, item.GetName(), item.GetArtist(), item.GetAlbum());
|
||||
break;
|
||||
case 1:
|
||||
PlayNext(item.GetPath(), item.GetName(), item.GetArtist(), item.GetAlbum());
|
||||
PlayNext(item.youtubeID, item.GetName(), item.GetArtist(), item.GetAlbum());
|
||||
break;
|
||||
case 2:
|
||||
PlayLast(item.GetPath(), item.GetName(), item.GetArtist(), item.GetAlbum());
|
||||
PlayLast(item.youtubeID, item.GetName(), item.GetArtist(), item.GetAlbum());
|
||||
break;
|
||||
case 3:
|
||||
GetPlaylists(item.GetPath(), Activity);
|
||||
GetPlaylists(item.youtubeID, Activity);
|
||||
break;
|
||||
case 4:
|
||||
Download(item.GetName(), item.GetPath());
|
||||
Download(item.GetName(), item.youtubeID);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -670,7 +670,7 @@ namespace MusicApp.Resources.Portable_Class
|
||||
|
||||
foreach (var item in ytPlaylist.Items)
|
||||
{
|
||||
if (item.Snippet.Title != "Deleted video")
|
||||
if (item.Snippet.Title != "[Deleted video]" && item.Snippet.Title != "Private video" && item.Snippet.Title != "Deleted video")
|
||||
{
|
||||
Song song = new Song(item.Snippet.Title, "", item.Snippet.Thumbnails.Default__.Url, item.ContentDetails.VideoId, -1, -1, item.ContentDetails.VideoId, true, false);
|
||||
tracks.Add(song);
|
||||
|
||||
Reference in New Issue
Block a user