Skip to content

Kavita is a fast, feature rich, cross platform reading server. Built with the goal of being a full solution for all your reading needs. Setup your own server and share your reading collection with your friends and family.

505 B
Raw Blame
using System;
using System.IO;

namespace API.Extensions;

public static class FileInfoExtensions
{
    /// <summary>
    /// Checks if the last write time of the file is after the passed date
    /// </summary>
    /// <param name="fileInfo"></param>
    /// <param name="comparison"></param>
    /// <returns></returns>
    public static bool HasFileBeenModifiedSince(this FileInfo fileInfo, DateTime comparison)
    {
        return DateTime.Compare(fileInfo.LastWriteTime, comparison) > 0;
    }
}