1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 18:07:24 +08:00
osu-lazer/osu.Game/IO/FileInfo.cs
Dean Herbert 404497fa10 Allow a single beatmap to reference the same file multiple times
This fixes incorrect reference counts causing database desync.
2017-07-31 21:49:57 +09:00

23 lines
591 B
C#

// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System.IO;
using SQLite.Net.Attributes;
namespace osu.Game.IO
{
public class FileInfo
{
[PrimaryKey, AutoIncrement]
public int ID { get; set; }
[Indexed(Unique = true)]
public string Hash { get; set; }
public string StoragePath => Path.Combine(Hash.Remove(1), Hash.Remove(2), Hash);
[Indexed]
public int ReferenceCount { get; set; }
}
}