-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
910065f
commit bcea6cf
Showing
5 changed files
with
67 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
24 changes: 24 additions & 0 deletions
24
OneShelf.Videos/OneShelf.Videos.Telegram.Processor/Commands/GetFileSize.cs
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,24 @@ | ||
using OneShelf.Telegram.Model.CommandAttributes; | ||
using OneShelf.Telegram.Model.Ios; | ||
using OneShelf.Telegram.Services.Base; | ||
using OneShelf.Videos.Database; | ||
|
||
namespace OneShelf.Videos.Telegram.Processor.Commands; | ||
|
||
[AdminCommand("get_file_size", "Файлик", "Посмотреть файл")] | ||
public class GetFileSize : Command | ||
{ | ||
private readonly VideosDatabase _videosDatabase; | ||
|
||
public GetFileSize(Io io, VideosDatabase videosDatabase) | ||
: base(io) | ||
{ | ||
_videosDatabase = videosDatabase; | ||
} | ||
|
||
protected override async Task ExecuteQuickly() | ||
{ | ||
var path = Io.FreeChoice("Path to file:"); | ||
Io.WriteLine(new FileInfo(path).Length.ToString()); | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
OneShelf.Videos/OneShelf.Videos.Telegram.Processor/Commands/ListAlbums.cs
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,32 @@ | ||
using OneShelf.Telegram.Model.CommandAttributes; | ||
using OneShelf.Telegram.Model.Ios; | ||
using OneShelf.Telegram.Services.Base; | ||
using OneShelf.Videos.BusinessLogic.Services; | ||
|
||
namespace OneShelf.Videos.Telegram.Processor.Commands; | ||
|
||
[AdminCommand("get_file_size", "Файлик", "Посмотреть файл")] | ||
public class ListAlbums : Command | ||
{ | ||
private readonly Service2 _service2; | ||
|
||
public ListAlbums(Io io, Service2 service2) | ||
: base(io) | ||
{ | ||
_service2 = service2; | ||
} | ||
|
||
protected override async Task ExecuteQuickly() | ||
{ | ||
Scheduled(List()); | ||
} | ||
|
||
private async Task List() | ||
{ | ||
var albums = await _service2.ListAlbums(); | ||
foreach (var album in albums) | ||
{ | ||
Io.WriteLine(album); | ||
} | ||
} | ||
} |
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
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