mirror of
				https://gitlab.com/Kwoth/nadekobot.git
				synced 2025-11-04 08:34:27 -05:00 
			
		
		
		
	Massive cleanup
- Removed GuildConfigs repository, moved to extensions - Moved StreamSettings extension to GuildConfig extensions - namespace NadekoBot.Core has been simplified to NadekoBot in many places (more to come) - Replaced some raw delete queries with simple linqtodb queries
This commit is contained in:
		@@ -1,6 +1,6 @@
 | 
			
		||||
using System;
 | 
			
		||||
 | 
			
		||||
namespace NadekoBot.Core.Modules.Music
 | 
			
		||||
namespace NadekoBot.Modules.Music
 | 
			
		||||
{
 | 
			
		||||
    public interface ICachableTrackData
 | 
			
		||||
    {
 | 
			
		||||
 
 | 
			
		||||
@@ -1,6 +1,6 @@
 | 
			
		||||
using System.Collections.Generic;
 | 
			
		||||
 | 
			
		||||
namespace NadekoBot.Core.Modules.Music
 | 
			
		||||
namespace NadekoBot.Modules.Music
 | 
			
		||||
{
 | 
			
		||||
    public interface ILocalTrackResolver : IPlatformQueryResolver
 | 
			
		||||
    {
 | 
			
		||||
 
 | 
			
		||||
@@ -4,7 +4,7 @@ using System.Threading.Tasks;
 | 
			
		||||
using NadekoBot.Core.Services.Database.Models;
 | 
			
		||||
 | 
			
		||||
#nullable enable
 | 
			
		||||
namespace NadekoBot.Core.Modules.Music
 | 
			
		||||
namespace NadekoBot.Modules.Music
 | 
			
		||||
{
 | 
			
		||||
    public interface IMusicPlayer : IDisposable
 | 
			
		||||
    {
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
using System;
 | 
			
		||||
using System.Collections.Generic;
 | 
			
		||||
 | 
			
		||||
namespace NadekoBot.Core.Modules.Music
 | 
			
		||||
namespace NadekoBot.Modules.Music
 | 
			
		||||
{
 | 
			
		||||
    public interface IMusicQueue
 | 
			
		||||
    {
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
#nullable enable
 | 
			
		||||
using System.Threading.Tasks;
 | 
			
		||||
 | 
			
		||||
namespace NadekoBot.Core.Modules.Music
 | 
			
		||||
namespace NadekoBot.Modules.Music
 | 
			
		||||
{
 | 
			
		||||
    public interface IPlatformQueryResolver
 | 
			
		||||
    {
 | 
			
		||||
 
 | 
			
		||||
@@ -1,4 +1,4 @@
 | 
			
		||||
namespace NadekoBot.Core.Modules.Music
 | 
			
		||||
namespace NadekoBot.Modules.Music
 | 
			
		||||
{
 | 
			
		||||
    public interface IQueuedTrackInfo : ITrackInfo
 | 
			
		||||
    {
 | 
			
		||||
 
 | 
			
		||||
@@ -1,4 +1,4 @@
 | 
			
		||||
namespace NadekoBot.Core.Modules.Music
 | 
			
		||||
namespace NadekoBot.Modules.Music
 | 
			
		||||
{
 | 
			
		||||
    public interface IRadioResolver : IPlatformQueryResolver
 | 
			
		||||
    {
 | 
			
		||||
 
 | 
			
		||||
@@ -1,6 +1,6 @@
 | 
			
		||||
using System.Collections.Generic;
 | 
			
		||||
 | 
			
		||||
namespace NadekoBot.Core.Modules.Music
 | 
			
		||||
namespace NadekoBot.Modules.Music
 | 
			
		||||
{
 | 
			
		||||
    public interface ISoundcloudResolver : IPlatformQueryResolver
 | 
			
		||||
    {
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@ using System;
 | 
			
		||||
using System.Collections.Generic;
 | 
			
		||||
using System.Threading.Tasks;
 | 
			
		||||
 | 
			
		||||
namespace NadekoBot.Core.Modules.Music
 | 
			
		||||
namespace NadekoBot.Modules.Music
 | 
			
		||||
{
 | 
			
		||||
    public interface ITrackCacher
 | 
			
		||||
    {
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
using System;
 | 
			
		||||
using System.Threading.Tasks;
 | 
			
		||||
 | 
			
		||||
namespace NadekoBot.Core.Modules.Music
 | 
			
		||||
namespace NadekoBot.Modules.Music
 | 
			
		||||
{
 | 
			
		||||
    public interface ITrackInfo
 | 
			
		||||
    {
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
#nullable enable
 | 
			
		||||
using System.Threading.Tasks;
 | 
			
		||||
 | 
			
		||||
namespace NadekoBot.Core.Modules.Music
 | 
			
		||||
namespace NadekoBot.Modules.Music
 | 
			
		||||
{
 | 
			
		||||
    public interface ITrackResolveProvider
 | 
			
		||||
    {
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@ using System.Collections.Generic;
 | 
			
		||||
using System.Text.RegularExpressions;
 | 
			
		||||
using System.Threading.Tasks;
 | 
			
		||||
 | 
			
		||||
namespace NadekoBot.Core.Modules.Music
 | 
			
		||||
namespace NadekoBot.Modules.Music
 | 
			
		||||
{
 | 
			
		||||
    public interface IYoutubeResolver : IPlatformQueryResolver
 | 
			
		||||
    {
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
using System;
 | 
			
		||||
using System.Text.Json.Serialization;
 | 
			
		||||
 | 
			
		||||
namespace NadekoBot.Core.Modules.Music
 | 
			
		||||
namespace NadekoBot.Modules.Music
 | 
			
		||||
{
 | 
			
		||||
    public sealed class CachableTrackData : ICachableTrackData
 | 
			
		||||
    {
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
using System.Runtime.InteropServices;
 | 
			
		||||
using Serilog;
 | 
			
		||||
 | 
			
		||||
namespace NadekoBot.Core.Modules.Music.Common
 | 
			
		||||
namespace NadekoBot.Modules.Music.Common
 | 
			
		||||
{
 | 
			
		||||
    public sealed class MultimediaTimer : IDisposable
 | 
			
		||||
    {
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
using Discord;
 | 
			
		||||
using NadekoBot.Extensions;
 | 
			
		||||
 | 
			
		||||
namespace NadekoBot.Core.Modules.Music
 | 
			
		||||
namespace NadekoBot.Modules.Music
 | 
			
		||||
{
 | 
			
		||||
    public static class MusicExtensions
 | 
			
		||||
    {
 | 
			
		||||
 
 | 
			
		||||
@@ -1,4 +1,4 @@
 | 
			
		||||
namespace NadekoBot.Core.Modules.Music
 | 
			
		||||
namespace NadekoBot.Modules.Music
 | 
			
		||||
{
 | 
			
		||||
    public enum MusicPlatform
 | 
			
		||||
    {
 | 
			
		||||
 
 | 
			
		||||
@@ -10,13 +10,13 @@ using System.Threading;
 | 
			
		||||
using System.Threading.Tasks;
 | 
			
		||||
using Ayu.Discord.Voice;
 | 
			
		||||
using NadekoBot.Common;
 | 
			
		||||
using NadekoBot.Core.Modules.Music.Common;
 | 
			
		||||
using NadekoBot.Modules.Music.Common;
 | 
			
		||||
using NadekoBot.Core.Services.Database.Models;
 | 
			
		||||
using NadekoBot.Extensions;
 | 
			
		||||
using NadekoBot.Modules.Music;
 | 
			
		||||
using Serilog;
 | 
			
		||||
 | 
			
		||||
namespace NadekoBot.Core.Modules.Music
 | 
			
		||||
namespace NadekoBot.Modules.Music
 | 
			
		||||
{
 | 
			
		||||
    public sealed class MusicPlayer : IMusicPlayer
 | 
			
		||||
    {
 | 
			
		||||
 
 | 
			
		||||
@@ -4,7 +4,7 @@ using System.Collections.Generic;
 | 
			
		||||
using System.Linq;
 | 
			
		||||
using System.Threading.Tasks;
 | 
			
		||||
 | 
			
		||||
namespace NadekoBot.Core.Modules.Music
 | 
			
		||||
namespace NadekoBot.Modules.Music
 | 
			
		||||
{
 | 
			
		||||
    public sealed partial class MusicQueue
 | 
			
		||||
    {
 | 
			
		||||
 
 | 
			
		||||
@@ -8,7 +8,7 @@ using System.Threading.Tasks;
 | 
			
		||||
using Serilog;
 | 
			
		||||
using StackExchange.Redis;
 | 
			
		||||
 | 
			
		||||
namespace NadekoBot.Core.Modules.Music
 | 
			
		||||
namespace NadekoBot.Modules.Music
 | 
			
		||||
{
 | 
			
		||||
    public sealed class RedisTrackCacher : ITrackCacher
 | 
			
		||||
    {
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
using System;
 | 
			
		||||
using System.Threading.Tasks;
 | 
			
		||||
 | 
			
		||||
namespace NadekoBot.Core.Modules.Music
 | 
			
		||||
namespace NadekoBot.Modules.Music
 | 
			
		||||
{
 | 
			
		||||
    public sealed class RemoteTrackInfo : ITrackInfo
 | 
			
		||||
    {
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
using System;
 | 
			
		||||
using System.Threading.Tasks;
 | 
			
		||||
 | 
			
		||||
namespace NadekoBot.Core.Modules.Music
 | 
			
		||||
namespace NadekoBot.Modules.Music
 | 
			
		||||
{
 | 
			
		||||
    public sealed class SimpleTrackInfo : ITrackInfo
 | 
			
		||||
    {
 | 
			
		||||
 
 | 
			
		||||
@@ -6,7 +6,7 @@ using System.IO;
 | 
			
		||||
using System.Linq;
 | 
			
		||||
using System.Text;
 | 
			
		||||
using System.Threading.Tasks;
 | 
			
		||||
using NadekoBot.Core.Modules.Music;
 | 
			
		||||
using NadekoBot.Modules.Music;
 | 
			
		||||
using NadekoBot.Extensions;
 | 
			
		||||
using Serilog;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
using System.Net.Http;
 | 
			
		||||
using System.Text.RegularExpressions;
 | 
			
		||||
using System.Threading.Tasks;
 | 
			
		||||
using NadekoBot.Core.Modules.Music;
 | 
			
		||||
using NadekoBot.Modules.Music;
 | 
			
		||||
using NadekoBot.Extensions;
 | 
			
		||||
using Serilog;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -3,9 +3,8 @@ using System.Collections.Generic;
 | 
			
		||||
using System.Linq;
 | 
			
		||||
using System.Net.Http;
 | 
			
		||||
using System.Runtime.CompilerServices;
 | 
			
		||||
using NadekoBot.Core.Services.Impl;
 | 
			
		||||
using System.Threading.Tasks;
 | 
			
		||||
using NadekoBot.Core.Modules.Music;
 | 
			
		||||
using NadekoBot.Core.Services.Impl;
 | 
			
		||||
using NadekoBot.Extensions;
 | 
			
		||||
using Newtonsoft.Json.Linq;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@ using System;
 | 
			
		||||
using System.Threading.Tasks;
 | 
			
		||||
using Serilog;
 | 
			
		||||
 | 
			
		||||
namespace NadekoBot.Core.Modules.Music
 | 
			
		||||
namespace NadekoBot.Modules.Music
 | 
			
		||||
{
 | 
			
		||||
    public sealed class TrackResolveProvider : ITrackResolveProvider
 | 
			
		||||
    {
 | 
			
		||||
 
 | 
			
		||||
@@ -10,7 +10,7 @@ using NadekoBot.Core.Services.Impl;
 | 
			
		||||
using NadekoBot.Extensions;
 | 
			
		||||
using Serilog;
 | 
			
		||||
 | 
			
		||||
namespace NadekoBot.Core.Modules.Music
 | 
			
		||||
namespace NadekoBot.Modules.Music
 | 
			
		||||
{
 | 
			
		||||
    public sealed class YtdlYoutubeResolver : IYoutubeResolver
 | 
			
		||||
    {
 | 
			
		||||
 
 | 
			
		||||
@@ -13,7 +13,7 @@ using NadekoBot.Modules;
 | 
			
		||||
using NadekoBot.Modules.Administration.Services;
 | 
			
		||||
using NadekoBot.Modules.Music.Services;
 | 
			
		||||
 | 
			
		||||
namespace NadekoBot.Core.Modules.Music
 | 
			
		||||
namespace NadekoBot.Modules.Music
 | 
			
		||||
{
 | 
			
		||||
    [NoPublicBot]
 | 
			
		||||
    public sealed partial class Music : NadekoModule<IMusicService>
 | 
			
		||||
 
 | 
			
		||||
@@ -8,13 +8,15 @@ using Discord.Commands;
 | 
			
		||||
using NadekoBot.Common.Attributes;
 | 
			
		||||
using NadekoBot.Core.Services;
 | 
			
		||||
using NadekoBot.Core.Services.Database.Models;
 | 
			
		||||
using NadekoBot.Services;
 | 
			
		||||
using NadekoBot.Services.Database.Models;
 | 
			
		||||
using NadekoBot.Extensions;
 | 
			
		||||
using NadekoBot.Modules;
 | 
			
		||||
using NadekoBot.Modules.Music;
 | 
			
		||||
using NadekoBot.Modules.Music.Services;
 | 
			
		||||
using Serilog;
 | 
			
		||||
 | 
			
		||||
namespace NadekoBot.Core.Modules.Music
 | 
			
		||||
namespace NadekoBot.Modules.Music
 | 
			
		||||
{
 | 
			
		||||
    public sealed partial class Music
 | 
			
		||||
    {
 | 
			
		||||
 
 | 
			
		||||
@@ -4,7 +4,7 @@ using System.Diagnostics.CodeAnalysis;
 | 
			
		||||
using System.Threading.Tasks;
 | 
			
		||||
using Discord;
 | 
			
		||||
using NadekoBot.Core.Common;
 | 
			
		||||
using NadekoBot.Core.Modules.Music;
 | 
			
		||||
using NadekoBot.Modules.Music;
 | 
			
		||||
using NadekoBot.Core.Services.Database.Models;
 | 
			
		||||
 | 
			
		||||
namespace NadekoBot.Modules.Music.Services
 | 
			
		||||
 
 | 
			
		||||
@@ -7,10 +7,13 @@ using System.Linq;
 | 
			
		||||
using System.Threading.Tasks;
 | 
			
		||||
using Discord;
 | 
			
		||||
using Discord.WebSocket;
 | 
			
		||||
using NadekoBot.Core.Modules.Music;
 | 
			
		||||
using NadekoBot.Core.Services;
 | 
			
		||||
using NadekoBot.Core.Services.Database.Models;
 | 
			
		||||
using NadekoBot.Core.Services.Database.Repositories.Impl;
 | 
			
		||||
using NadekoBot.Modules.Music;
 | 
			
		||||
using NadekoBot.Services;
 | 
			
		||||
using NadekoBot.Services.Database.Models;
 | 
			
		||||
using NadekoBot.Services.Database.Repositories.Impl;
 | 
			
		||||
using NadekoBot.Extensions;
 | 
			
		||||
using Serilog;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -82,7 +82,7 @@
 | 
			
		||||
//             {
 | 
			
		||||
//                 using (var uow = _db.GetDbContext())
 | 
			
		||||
//                 {
 | 
			
		||||
//                     return uow.GuildConfigs.ForId(guildId, set => set).DefaultMusicVolume;
 | 
			
		||||
//                     return uow._context.GuildConfigsForId(guildId, set => set).DefaultMusicVolume;
 | 
			
		||||
//                 }
 | 
			
		||||
//             });
 | 
			
		||||
//         }
 | 
			
		||||
@@ -256,7 +256,7 @@
 | 
			
		||||
//             bool val;
 | 
			
		||||
//             using (var uow = _db.GetDbContext())
 | 
			
		||||
//             {
 | 
			
		||||
//                 var gc = uow.GuildConfigs.ForId(id, set => set);
 | 
			
		||||
//                 var gc = uow._context.GuildConfigsForId(id, set => set);
 | 
			
		||||
//                 val = gc.AutoDcFromVc = !gc.AutoDcFromVc;
 | 
			
		||||
//                 uow.SaveChanges();
 | 
			
		||||
//             }
 | 
			
		||||
@@ -278,7 +278,7 @@
 | 
			
		||||
//         {
 | 
			
		||||
//             using (var uow = _db.GetDbContext())
 | 
			
		||||
//             {
 | 
			
		||||
//                 var ms = uow.GuildConfigs.ForId(guildId, set => set.Include(x => x.MusicSettings)).MusicSettings;
 | 
			
		||||
//                 var ms = uow._context.GuildConfigsForId(guildId, set => set.Include(x => x.MusicSettings)).MusicSettings;
 | 
			
		||||
//                 ms.MusicChannelId = cid;
 | 
			
		||||
//                 uow.SaveChanges();
 | 
			
		||||
//             }
 | 
			
		||||
@@ -288,7 +288,7 @@
 | 
			
		||||
//         {
 | 
			
		||||
//             using (var uow = _db.GetDbContext())
 | 
			
		||||
//             {
 | 
			
		||||
//                 var ms = uow.GuildConfigs.ForId(guildId, set => set.Include(x => x.MusicSettings)).MusicSettings;
 | 
			
		||||
//                 var ms = uow._context.GuildConfigsForId(guildId, set => set.Include(x => x.MusicSettings)).MusicSettings;
 | 
			
		||||
//                 ms.SongAutoDelete = val;
 | 
			
		||||
//                 uow.SaveChanges();
 | 
			
		||||
//             }
 | 
			
		||||
 
 | 
			
		||||
@@ -395,7 +395,7 @@
 | 
			
		||||
//             }
 | 
			
		||||
//             using (var uow = _db.GetDbContext())
 | 
			
		||||
//             {
 | 
			
		||||
//                 uow.GuildConfigs.ForId(ctx.Guild.Id, set => set).DefaultMusicVolume = val / 100.0f;
 | 
			
		||||
//                 uow._context.GuildConfigsForId(ctx.Guild.Id, set => set).DefaultMusicVolume = val / 100.0f;
 | 
			
		||||
//                 uow.SaveChanges();
 | 
			
		||||
//             }
 | 
			
		||||
//             await ReplyConfirmLocalizedAsync("defvol_set", val).ConfigureAwait(false);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user