From b85d5109a1316e57c05c2f92b3779e3d6d350084 Mon Sep 17 00:00:00 2001 From: nishiki Date: Thu, 12 May 2016 16:48:57 +0200 Subject: [PATCH] add function get_last_sync --- lib/mpw/mpw.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/mpw/mpw.rb b/lib/mpw/mpw.rb index 4b1bddc..850be44 100644 --- a/lib/mpw/mpw.rb +++ b/lib/mpw/mpw.rb @@ -285,6 +285,13 @@ class MPW raise "#{I18n.t('error.import.read', file: file)}\n#{e}" end + # Get last sync + def get_last_sync + return @config['sync']['last_sync'].to_i + rescue + return 0 + end + # Generate a random password # @args: length -> the length password # @rtrn: a random string