Skip to content

Commit

Permalink
Changed season to 2014-2015
Browse files Browse the repository at this point in the history
  • Loading branch information
jstuckey committed Oct 8, 2014
1 parent 5fd5205 commit e6e8e40
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 18 deletions.
2 changes: 1 addition & 1 deletion configure.rb
Expand Up @@ -5,7 +5,7 @@
configure do

# Constants
CURRENTSEASON = "20132014"
CURRENTSEASON = "20142015"

# HTML Classes
SEASONLINKCLASS = "season"
Expand Down
2 changes: 1 addition & 1 deletion data/dailyscraper.py
Expand Up @@ -9,7 +9,7 @@
if __name__ == "__main__":

# Hardcode this season's seasonID
seasonID = '20132014'
seasonID = '20142015'

# Check if calling this script from the project root or the data folder
rootDir = True
Expand Down
12 changes: 6 additions & 6 deletions data/databasecheck.rb
Expand Up @@ -3,8 +3,8 @@

def getAllGames
allGames = Array.new
gameNumberToAdd = 2013020001
lastGameNumber = Season.all(:seasonID => '20132014').games.all(:order => :gameID).last.gameID.to_i
gameNumberToAdd = 2014020001
lastGameNumber = Season.all(:seasonID => '20142015').games.all(:order => :gameID).last.gameID.to_i

# Add game numbers to array
while gameNumberToAdd <= lastGameNumber do
Expand All @@ -18,7 +18,7 @@ def getAllGames

def getDatabaseGames
allGamesInDatabase = Array.new
games = Season.all(:seasonID => '20132014').games.all(:order => :gameID)
games = Season.all(:seasonID => '20142015').games.all(:order => :gameID)

games.each do |g|
allGamesInDatabase << g.gameID
Expand All @@ -35,7 +35,7 @@ def getDatabaseGames
end

puts
puts 'Getting games for the 2013-2014 season...'
puts 'Getting games for the 2014-2015 season...'
puts

# Get array of games
Expand All @@ -55,11 +55,11 @@ def getDatabaseGames

# Check if missing games were found
if missingGames.length > 0
puts "Missing games as of #{Season.all(:seasonID => '20132014').games.all(:order => :gameID).last.date}:"
puts "Missing games as of #{Season.all(:seasonID => '20142015').games.all(:order => :gameID).last.date}:"
missingGames.each do |mg|
puts mg
end
else
puts "No missing games as of #{Season.all(:seasonID => '20132014').games.all(:order => :gameID).last.date}."
puts "No missing games as of #{Season.all(:seasonID => '20142015').games.all(:order => :gameID).last.date}."
puts
end
1 change: 1 addition & 0 deletions data/databaseinit.rb
Expand Up @@ -28,6 +28,7 @@ def initDatabase
Season.create(:seasonID => "20112012")
Season.create(:seasonID => "20122013")
Season.create(:seasonID => "20132014")
Season.create(:seasonID => "20142015")
puts 'Added seasons to database.'

# Add teams
Expand Down
12 changes: 6 additions & 6 deletions data/newseason.rb
Expand Up @@ -3,19 +3,19 @@

def addSeason

# Add 2013-2014 season
Season.create(:seasonID => "20132014")
puts 'Added 2013-2014 season to database.'
# Add 2014-2015 season
Season.create(:seasonID => "20142015")
puts 'Added 2014-2015 season to database.'

# Add 2013-2014 season for all teams
# Add 2014-2015 season for all teams
teams = Team.all
teams.each do |t|
if t.teamID != "ATL"
t.seasons << Season.first(:seasonID => "20132014")
t.seasons << Season.first(:seasonID => "20142015")
t.save
end
end
puts 'Added 2013-2014 season to teams.'
puts 'Added 2014-2015 season to teams.'

end

Expand Down
2 changes: 1 addition & 1 deletion data/removeduplicates.rb
Expand Up @@ -4,7 +4,7 @@
puts "Checking for duplicate games..."
puts

allGames = Season.all(:seasonID => '20132014').games.all
allGames = Season.all(:seasonID => '20142015').games.all

duplicateGameIDs = Array.new

Expand Down
6 changes: 3 additions & 3 deletions public/scripts/siteActions.js
@@ -1,15 +1,15 @@
$(document).ready(function() {
// Season global var
currentSeasonID = '20132014';
currentSeasonID = '20142015';

// Game type global var
currentGameType = 'Playoffs'
currentGameType = 'Regular'

// Team global var
currentTeamID = null;

// Set selected default season
$("#seasonList").children().eq(1).addClass('selected');
$("#seasonList").children().eq(0).addClass('selected');

// Hide Atlanta <li> by default. Poor Thrashers...
$(".team:contains('Atlanta')").parent().hide();
Expand Down
Binary file modified toi.db
Binary file not shown.

0 comments on commit e6e8e40

Please sign in to comment.