added created date
Signed-off-by: Matt Bruce <mbrucedogs@gmail.com>
This commit is contained in:
parent
679eb9799f
commit
8c066afdac
@ -19,6 +19,7 @@ namespace SongCrawler
|
|||||||
{
|
{
|
||||||
static void Main(string[] args)
|
static void Main(string[] args)
|
||||||
{
|
{
|
||||||
|
args = new string[]{ "mbrucedogs", "z:\\" };
|
||||||
//FindDuplicates(args);
|
//FindDuplicates(args);
|
||||||
if (args.Last() == "-sl")
|
if (args.Last() == "-sl")
|
||||||
{
|
{
|
||||||
@ -115,7 +116,28 @@ namespace SongCrawler
|
|||||||
}
|
}
|
||||||
client.Set(firepath, songs);
|
client.Set(firepath, songs);
|
||||||
|
|
||||||
|
List<CreatedSong> created = new List<CreatedSong>();
|
||||||
|
foreach (Song s in songs)
|
||||||
|
{
|
||||||
|
created.Add(new CreatedSong(File.GetCreationTime(s.Path),s));
|
||||||
|
}
|
||||||
|
var first200 = created.Where(s => s.created != null).OrderByDescending(s => s.created).Take(200);
|
||||||
|
var added = first200.Select(s=>s.song).ToList();
|
||||||
|
string newSongs = string.Format("controllers/{0}/newSongs", controller);
|
||||||
|
client.Set(newSongs, added);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
public class CreatedSong
|
||||||
|
{
|
||||||
|
public DateTime created { get; set; }
|
||||||
|
public Song song { get; set; }
|
||||||
|
public CreatedSong(DateTime created, Song song)
|
||||||
|
{
|
||||||
|
this.song = song;
|
||||||
|
this.created = created;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private static void CrawlNoDupeSongs(string[] args)
|
private static void CrawlNoDupeSongs(string[] args)
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user